From e1785a82f2ee9893adc23e54e25904701f4004e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 14:58:20 +0000 Subject: [PATCH 01/33] Bump Submodule/github/rest-api-description from `ebc1fec` to `d5aff63` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `ebc1fec` to `d5aff63`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/ebc1fecbcfb4449cc61d45e2608ac765b5b144a0...d5aff63ff6b7c16e6342dc83ee3f03bac27eef23) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: d5aff63ff6b7c16e6342dc83ee3f03bac27eef23 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index ebc1fecbcf..d5aff63ff6 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit ebc1fecbcfb4449cc61d45e2608ac765b5b144a0 +Subproject commit d5aff63ff6b7c16e6342dc83ee3f03bac27eef23 From b74394e2ba5d918ea42e93721085caf2c2c10896 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:04:32 +0000 Subject: [PATCH 02/33] Commit via running: make Sources/actions --- Sources/actions/Client.swift | 4831 ++++++++++++++++++++++------------ Sources/actions/Types.swift | 4035 ++++++++++++++++++++++++---- 2 files changed, 6749 insertions(+), 2117 deletions(-) diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index 74bc1fc6aa..1aac61c879 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -38,24 +38,24 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// Get GitHub Actions cache usage for an organization + /// Get GitHub Actions cache retention limit for an enterprise /// - /// 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 GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. /// - /// 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:enterprise` 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(_ input: Operations.ActionsGetActionsCacheUsageForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)`. + public func actionsGetActionsCacheRetentionLimitForEnterprise(_ input: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheUsageForOrg.id, + forOperation: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/cache/usage", + template: "/enterprises/{}/actions/cache/retention-limit", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -72,13 +72,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.ActionsGetActionsCacheRetentionLimitForEnterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -88,7 +83,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheUsageOrgEnterprise.self, + Components.Schemas.ActionsCacheRetentionLimitForEnterprise.self, from: responseBody, transforming: { value in .json(value) @@ -97,77 +92,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 - ) - ) - } - } - ) - } - /// 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 - )) + return .ok(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -177,7 +105,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -186,76 +114,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 - ) - ) - } - } - ) - } - /// 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 - )) + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -265,7 +127,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -274,10 +136,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -290,27 +149,29 @@ public struct Client: APIProtocol { } ) } - /// Create a GitHub-hosted runner for an organization + /// Set GitHub Actions cache retention limit for an enterprise /// - /// Creates a GitHub-hosted runner for an organization. - /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// Sets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. /// - /// - 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 tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)`. + public func actionsSetActionsCacheRetentionLimitForEnterprise(_ input: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners", + template: "/enterprises/{}/actions/cache/retention-limit", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -330,9 +191,42 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -342,7 +236,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -351,7 +245,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -364,23 +280,24 @@ public struct Client: APIProtocol { } ) } - /// List custom images for an organization + /// Get GitHub Actions cache storage limit for an enterprise /// - /// List custom images for an organization. + /// Gets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. /// - /// OAuth 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:enterprise` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. - public func actionsListCustomImagesForOrg(_ input: Operations.ActionsListCustomImagesForOrg.Input) async throws -> Operations.ActionsListCustomImagesForOrg.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)`. + public func actionsGetActionsCacheStorageLimitForEnterprise(_ input: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output { try await client.send( input: input, - forOperation: Operations.ActionsListCustomImagesForOrg.id, + forOperation: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom", + template: "/enterprises/{}/actions/cache/storage-limit", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -398,7 +315,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListCustomImagesForOrg.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -408,7 +325,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListCustomImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheStorageLimitForEnterprise.self, from: responseBody, transforming: { value in .json(value) @@ -418,6 +335,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, @@ -430,104 +391,125 @@ public struct Client: APIProtocol { } ) } - /// Get a custom image definition for GitHub Actions Hosted Runners + /// Set GitHub Actions cache storage limit for an enterprise /// - /// Get a custom image definition for GitHub Actions Hosted Runners. + /// Sets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. /// - /// OAuth 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:enterprise` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. - public func actionsGetCustomImageForOrg(_ input: Operations.ActionsGetCustomImageForOrg.Input) async throws -> Operations.ActionsGetCustomImageForOrg.Output { + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)`. + public func actionsSetActionsCacheStorageLimitForEnterprise(_ input: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetCustomImageForOrg.id, + forOperation: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom/{}", + template: "/enterprises/{}/actions/cache/storage-limit", parameters: [ - input.path.org, - input.path.imageDefinitionId + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetCustomImageForOrg.Output.Ok.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerCustomImage.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Delete a custom image from the organization - /// - /// Delete a custom image from the organization. - /// - /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. - public func actionsDeleteCustomImageFromOrg(_ input: Operations.ActionsDeleteCustomImageFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageFromOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteCustomImageFromOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom/{}", - parameters: [ - input.path.org, - input.path.imageDefinitionId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + 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, @@ -540,24 +522,24 @@ public struct Client: APIProtocol { } ) } - /// List image versions of a custom image for an organization + /// Get GitHub Actions cache retention limit for an organization /// - /// List image versions of a custom image for an organization. + /// Gets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. /// - /// OAuth 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:organization` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. - public func actionsListCustomImageVersionsForOrg(_ input: Operations.ActionsListCustomImageVersionsForOrg.Input) async throws -> Operations.ActionsListCustomImageVersionsForOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-organization)`. + public func actionsGetActionsCacheRetentionLimitForOrganization(_ input: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListCustomImageVersionsForOrg.id, + forOperation: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions", + template: "/organizations/{}/actions/cache/retention-limit", parameters: [ - input.path.org, - input.path.imageDefinitionId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -575,7 +557,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -585,7 +567,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheRetentionLimitForOrganization.self, from: responseBody, transforming: { value in .json(value) @@ -595,6 +577,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, @@ -607,151 +633,106 @@ public struct Client: APIProtocol { } ) } - /// Get an image version of a custom image for GitHub Actions Hosted Runners + /// Set GitHub Actions cache retention limit for an organization /// - /// Get an image version of a custom image for GitHub Actions Hosted Runners. + /// Sets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. /// - /// OAuth 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:organization` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. - public func actionsGetCustomImageVersionForOrg(_ input: Operations.ActionsGetCustomImageVersionForOrg.Input) async throws -> Operations.ActionsGetCustomImageVersionForOrg.Output { + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)`. + public func actionsSetActionsCacheRetentionLimitForOrganization(_ input: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetCustomImageVersionForOrg.id, + forOperation: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", + template: "/organizations/{}/actions/cache/retention-limit", parameters: [ - input.path.org, - input.path.imageDefinitionId, - input.path.version + 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 contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetCustomImageVersionForOrg.Output.Ok.Body + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerCustomImageVersion.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Delete an image version of custom image from the organization - /// - /// Delete an image version of custom image from the organization. - /// - /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. - public func actionsDeleteCustomImageVersionFromOrg(_ input: Operations.ActionsDeleteCustomImageVersionFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageVersionFromOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteCustomImageVersionFromOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", - parameters: [ - input.path.org, - input.path.imageDefinitionId, - input.path.version - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } ) - ) - } - } - ) - } - /// 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: + 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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -761,7 +742,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -770,7 +751,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -783,19 +764,22 @@ public struct Client: APIProtocol { } ) } - /// Get partner images for GitHub-hosted runners in an organization + /// Get GitHub Actions cache storage limit for an organization /// - /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// Gets GitHub Actions cache storage limit for an organization. All repositories under this + /// organization may not set a higher cache storage limit. /// - /// - 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:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-organization)`. + public func actionsGetActionsCacheStorageLimitForOrganization(_ input: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, + forOperation: Operations.ActionsGetActionsCacheStorageLimitForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/partner", + template: "/organizations/{}/actions/cache/storage-limit", parameters: [ input.path.org ] @@ -815,7 +799,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -825,7 +809,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheStorageLimitForOrganization.self, from: responseBody, transforming: { value in .json(value) @@ -835,51 +819,31 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Get limits on GitHub-hosted runners for an organization - /// - /// Get the GitHub-hosted runners limits for an organization. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. - public func actionsGetHostedRunnersLimitsForOrg(_ input: Operations.ActionsGetHostedRunnersLimitsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersLimitsForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/limits", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + 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.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -889,7 +853,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerLimits.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -898,7 +862,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -911,60 +875,127 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-hosted runners machine specs for an organization + /// Set GitHub Actions cache storage limit for an organization /// - /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// Sets GitHub Actions cache storage limit for an organization. All organizations and repositories under this + /// organization may not set a higher cache storage limit. /// - /// - 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 tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)`. + public func actionsSetActionsCacheStorageLimitForOrganization(_ input: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, + forOperation: Operations.ActionsSetActionsCacheStorageLimitForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/machine-sizes", + template: "/organizations/{}/actions/cache/storage-limit", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( statusCode: response.status.code, .init( headerFields: response.headerFields, @@ -975,19 +1006,22 @@ public struct Client: APIProtocol { } ) } - /// Get platforms for GitHub-hosted runners in an organization + /// Get GitHub Actions cache usage for an organization /// - /// Get the list of platforms available for GitHub-hosted runners 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. /// - /// - 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 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(_ input: Operations.ActionsGetActionsCacheUsageForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, + forOperation: Operations.ActionsGetActionsCacheUsageForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/platforms", + template: "/orgs/{}/actions/cache/usage", parameters: [ input.path.org ] @@ -1006,8 +1040,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.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1017,7 +1056,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheUsageOrgEnterprise.self, from: responseBody, transforming: { value in .json(value) @@ -1026,7 +1065,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -1039,24 +1081,24 @@ public struct Client: APIProtocol { } ) } - /// Get a GitHub-hosted runner for an organization + /// List repositories with GitHub Actions cache usage for an organization /// - /// Gets a GitHub-hosted runner configured in 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 `manage_runners:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. - public func actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /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.ActionsGetHostedRunnerForOrg.id, + forOperation: Operations.ActionsGetActionsCacheUsageByRepoForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/cache/usage-by-repository", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1064,6 +1106,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 @@ -1073,13 +1129,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( + let headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1089,7 +1145,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1114,50 +1170,60 @@ public struct Client: APIProtocol { } ) } - /// Update a GitHub-hosted runner for an organization + /// List GitHub-hosted runners 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. + /// Lists all GitHub-hosted runners configured in an organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. - public func actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { + /// OAuth app tokens and personal access tokens (classic) need the `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.ActionsUpdateHostedRunnerForOrg.id, + forOperation: Operations.ActionsListHostedRunnersForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/hosted-runners", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + 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 ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.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.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1167,7 +1233,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1176,7 +1242,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -1189,40 +1258,49 @@ public struct Client: APIProtocol { } ) } - /// Delete a GitHub-hosted runner for an organization + /// Create a GitHub-hosted runner for an organization /// - /// Deletes 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 `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 { + /// - 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.ActionsDeleteHostedRunnerForOrg.id, + forOperation: Operations.ActionsCreateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/hosted-runners", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 202: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + let body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1241,7 +1319,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .accepted(.init(body: body)) + return .created(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1254,21 +1332,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for an organization + /// List custom images for an organization /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// List custom images for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. - public func actionsGetGithubActionsPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. + public func actionsListCustomImagesForOrg(_ input: Operations.ActionsListCustomImagesForOrg.Input) async throws -> Operations.ActionsListCustomImagesForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsListCustomImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/orgs/{}/actions/hosted-runners/images/custom", parameters: [ input.path.org ] @@ -1288,7 +1366,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.ActionsListCustomImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1298,7 +1376,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsOrganizationPermissions.self, + Operations.ActionsListCustomImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1320,40 +1398,99 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for an organization + /// Get a custom image definition for GitHub Actions Hosted Runners /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Get a custom image definition for GitHub Actions Hosted Runners. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. - public func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. + public func actionsGetCustomImageForOrg(_ input: Operations.ActionsGetCustomImageForOrg.Input) async throws -> Operations.ActionsGetCustomImageForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsGetCustomImageForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}", parameters: [ - input.path.org + input.path.org, + input.path.imageDefinitionId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" + 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.ActionsGetCustomImageForOrg.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.ActionsHostedRunnerCustomImage.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) } - return (request, body) + } + ) + } + /// Delete a custom image from the organization + /// + /// Delete a custom image from the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. + public func actionsDeleteCustomImageFromOrg(_ input: Operations.ActionsDeleteCustomImageFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageFromOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteCustomImageFromOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/custom/{}", + parameters: [ + input.path.org, + input.path.imageDefinitionId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { @@ -1371,23 +1508,24 @@ public struct Client: APIProtocol { } ) } - /// Get artifact and log retention settings for an organization + /// List image versions of a custom image for an organization /// - /// Gets artifact and log retention settings for an organization. + /// List image versions of a custom image 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. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope 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 { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. + public func actionsListCustomImageVersionsForOrg(_ input: Operations.ActionsListCustomImageVersionsForOrg.Input) async throws -> Operations.ActionsListCustomImageVersionsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, + forOperation: Operations.ActionsListCustomImageVersionsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/artifact-and-log-retention", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions", parameters: [ - input.path.org + input.path.org, + input.path.imageDefinitionId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1405,7 +1543,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body + let body: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1415,7 +1553,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, + Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1425,31 +1563,55 @@ 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: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: + ) + } + } + ) + } + /// Get an image version of a custom image for GitHub Actions Hosted Runners + /// + /// Get an image version of a custom image for GitHub Actions Hosted Runners. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. + public func actionsGetCustomImageVersionForOrg(_ input: Operations.ActionsGetCustomImageVersionForOrg.Input) async throws -> Operations.ActionsGetCustomImageVersionForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetCustomImageVersionForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", + parameters: [ + input.path.org, + input.path.imageDefinitionId, + input.path.version + ] + ) + 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.ActionsGetCustomImageVersionForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1459,7 +1621,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsHostedRunnerCustomImageVersion.self, from: responseBody, transforming: { value in .json(value) @@ -1468,7 +1630,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1481,52 +1643,83 @@ public struct Client: APIProtocol { } ) } - /// Set artifact and log retention settings for an organization + /// Delete an image version of custom image from the organization /// - /// Sets artifact and log retention settings for an organization. + /// Delete an image version of custom image from the 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 `manage_runners:org` scope 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)`. - public func actionsSetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. + public func actionsDeleteCustomImageVersionFromOrg(_ input: Operations.ActionsDeleteCustomImageVersionFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageVersionFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, + forOperation: Operations.ActionsDeleteCustomImageVersionFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/artifact-and-log-retention", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", + parameters: [ + input.path.org, + input.path.imageDefinitionId, + input.path.version + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get 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: .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: Components.Responses.Forbidden.Body + let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1536,7 +1729,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) @@ -1545,54 +1738,52 @@ 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: + } + } + ) + } + /// Get partner images for GitHub-hosted runners in an organization + /// + /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public func actionsGetHostedRunnersPartnerImagesForOrg(_ input: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/partner", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1602,7 +1793,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1611,7 +1802,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, @@ -1624,21 +1815,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 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 /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 { + /// - 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.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", + template: "/orgs/{}/actions/hosted-runners/limits", parameters: [ input.path.org ] @@ -1658,7 +1847,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.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1668,7 +1857,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsForkPrContributorApproval.self, + Components.Schemas.ActionsHostedRunnerLimits.self, from: responseBody, transforming: { value in .json(value) @@ -1678,28 +1867,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, @@ -1712,52 +1879,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 GitHub-hosted runners machine specs for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `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 { + /// - 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.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", + template: "/orgs/{}/actions/hosted-runners/machine-sizes", 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: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1767,7 +1921,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1776,10 +1930,52 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get platforms for GitHub-hosted runners in an organization + /// + /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public func actionsGetHostedRunnersPlatformsForOrg(_ input: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPlatformsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/platforms", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1789,7 +1985,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1798,7 +1994,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, @@ -1811,21 +2007,24 @@ public struct Client: APIProtocol { } ) } - /// Get private repo fork PR workflow settings for an organization + /// Get a GitHub-hosted runner for an organization /// - /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Gets a GitHub-hosted runner configured 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(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public func actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ - input.path.org + input.path.org, + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1842,8 +2041,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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1853,7 +2057,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -1862,51 +2066,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -1919,26 +2082,28 @@ public struct Client: APIProtocol { } ) } - /// Set private repo fork PR workflow settings for an organization + /// Update a GitHub-hosted runner for an organization /// - /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - 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 { + /// - 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.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, + forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", + 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( @@ -1958,11 +2123,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: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body + let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1972,7 +2135,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) @@ -1981,32 +2144,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 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: [ @@ -2016,7 +2200,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) @@ -2025,7 +2209,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, @@ -2038,21 +2222,21 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories enabled for GitHub Actions in an organization + /// Get GitHub Actions permissions for an organization /// - /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. - public func actionsListSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -2062,20 +2246,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 @@ -2086,7 +2256,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2096,7 +2266,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsOrganizationPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -2118,22 +2288,21 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories enabled for GitHub Actions in an organization - /// - /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Set GitHub Actions permissions for an organization /// + /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - Remark: HTTP `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.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -2170,273 +2339,68 @@ public struct Client: APIProtocol { } ) } - /// Enable a selected repository for GitHub Actions in an organization + /// Get artifact and log retention settings 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 artifact and log retention settings 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(_ input: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { + /// - 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.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, + forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.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.ActionsArtifactAndLogRetentionResponse.self, + from: responseBody, + transforming: { value in + .json(value) + } ) - ) - } - } - ) - } - /// Disable a selected repository for GitHub Actions in an organization - /// - /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. - public func actionsDisableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", - parameters: [ - input.path.org, - input.path.repositoryId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get allowed actions and reusable workflows for an organization - /// - /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. - public func actionsGetAllowedActionsOrganization(_ input: Operations.ActionsGetAllowedActionsOrganization.Input) async throws -> Operations.ActionsGetAllowedActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsGetAllowedActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/selected-actions", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetAllowedActionsOrganization.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.SelectedActions.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Set 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" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// 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(_ input: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.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" - ] + 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": @@ -2485,21 +2449,21 @@ public struct Client: APIProtocol { } ) } - /// Set self-hosted runners settings for an organization + /// Set artifact and log retention settings for an organization /// - /// Sets the settings for self-hosted runners 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/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 { + /// - 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.ActionsSetSelfHostedRunnersPermissionsOrganization.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners", + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.org ] @@ -2628,21 +2592,21 @@ public struct Client: APIProtocol { } ) } - /// List repositories allowed to use self-hosted runners in an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Lists 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 `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 { + /// - 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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] @@ -2652,20 +2616,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 @@ -2676,7 +2626,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.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2686,7 +2636,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -2696,28 +2646,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 @@ -2752,21 +2680,21 @@ public struct Client: APIProtocol { } ) } - /// Set repositories allowed to use self-hosted runners in an organization + /// Set fork PR contributor approval permissions for an organization /// - /// Sets repositories that are allowed to use self-hosted runners in 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 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 /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 { + /// - 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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] @@ -2795,28 +2723,6 @@ public struct Client: APIProtocol { 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 @@ -2873,29 +2779,26 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Get private repo fork PR workflow 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. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an 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 func actionsEnableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.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.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", + template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2906,11 +2809,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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2920,7 +2821,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -2929,10 +2830,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: [ @@ -2951,10 +2852,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 409: + return .forbidden(.init(body: body)) + 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: [ @@ -2973,29 +2874,7 @@ public struct Client: APIProtocol { 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 .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3008,36 +2887,42 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Set private repo fork PR workflow 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. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an 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 func actionsDisableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", + template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + 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 { @@ -3045,7 +2930,7 @@ public struct Client: APIProtocol { return .noContent(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3087,28 +2972,6 @@ public struct Client: APIProtocol { 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 @@ -3143,23 +3006,21 @@ public struct Client: APIProtocol { } ) } - /// Get default workflow permissions for an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, - /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. - public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/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.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ input.path.org ] @@ -3169,6 +3030,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 @@ -3179,7 +3054,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3189,7 +3064,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsGetDefaultWorkflowPermissions.self, + Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3211,23 +3086,22 @@ public struct Client: APIProtocol { } ) } - /// Set default workflow permissions for an organization + /// Set selected repositories enabled for GitHub Actions in an organization + /// + /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions - /// can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. - public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ input.path.org ] @@ -3239,10 +3113,8 @@ public struct Client: APIProtocol { suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -3266,81 +3138,37 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runner groups for an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. - public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { + /// - Remark: HTTP `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.ActionsListSelfHostedRunnerGroupsForOrg.id, + forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + 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) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "visible_to_repository", - value: input.query.visibleToRepository - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnerGroupsForOrg.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, @@ -3353,69 +3181,37 @@ public struct Client: APIProtocol { } ) } - /// Create a self-hosted runner group for an organization + /// Disable a selected repository for GitHub Actions in an organization /// - /// Creates a new self-hosted runner group for an organization. + /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. - public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `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.ActionsCreateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + template: "/orgs/{}/actions/permissions/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.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.RunnerGroupsOrg.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, @@ -3428,24 +3224,23 @@ public struct Client: APIProtocol { } ) } - /// Get a self-hosted runner group for an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Gets a specific self-hosted runner group for an organization. + /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. - public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/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.ActionsGetSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsGetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3463,7 +3258,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3473,7 +3268,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Components.Schemas.SelectedActions.self, from: responseBody, transforming: { value in .json(value) @@ -3495,39 +3290,36 @@ public struct Client: APIProtocol { } ) } - /// Update a self-hosted runner group for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Updates the `name` and `visibility` of a self-hosted runner group 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)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. - public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. + public func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsSetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) let body: OpenAPIRuntime.HTTPBody? switch input.body { + case .none: + body = nil case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( + body = try converter.setOptionalRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -3537,28 +3329,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.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.RunnerGroupsOrg.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, @@ -3571,61 +3343,1257 @@ public struct Client: APIProtocol { } ) } - /// Delete a self-hosted runner group from an organization + /// Get self-hosted runners settings for an organization /// - /// Deletes a self-hosted runner group for 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 `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. - public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { + /// - Remark: HTTP `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.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, + forOperation: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) 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 - ) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// List GitHub-hosted runners in a group for an organization - /// - /// Lists the GitHub-hosted runners in an organization group. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. - public func actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, + 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 chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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(_ input: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/self-hosted-runners", + 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 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List 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(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/self-hosted-runners/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: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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(_ input: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", + 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 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 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 + ) + ) + } + } + ) + } + /// 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(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + 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, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get default workflow permissions for an organization + /// + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, + /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. + public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/workflow", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsGetDefaultWorkflowPermissions.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set default workflow permissions for an organization + /// + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions + /// can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. + public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/workflow", + 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" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelfHostedRunnerGroupsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "visible_to_repository", + value: input.query.visibleToRepository + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.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.RunnerGroupsOrg.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetSelfHostedRunnerGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.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.RunnerGroupsOrg.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.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.RunnerGroupsOrg.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List GitHub-hosted runners in a group for an organization + /// + /// Lists the GitHub-hosted runners in an organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public func actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/actions/runner-groups/{}/hosted-runners", @@ -6070,10 +7038,179 @@ public struct Client: APIProtocol { public func actionsGetOrgVariable(_ input: Operations.ActionsGetOrgVariable.Input) async throws -> Operations.ActionsGetOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgVariable.id, + forOperation: Operations.ActionsGetOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetOrgVariable.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.OrganizationActionsVariable.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an organization variable + /// + /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. + public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsUpdateOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + 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 + ) + ) + } + } + ) + } + /// Delete an organization variable + /// + /// Deletes an organization variable using the variable name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. + public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List selected repositories for an organization variable + /// + /// Lists all repositories that can access an organization variable + /// that is available to selected repositories. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. + public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/variables/{}/repositories", parameters: [ input.path.org, input.path.name @@ -6084,6 +7221,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -6094,7 +7245,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgVariable.Output.Ok.Body + let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6104,7 +7255,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationActionsVariable.self, + Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -6114,6 +7265,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -6126,23 +7279,25 @@ public struct Client: APIProtocol { } ) } - /// Update an organization variable + /// Set selected repositories for an organization variable /// - /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// Replaces all repositories for an organization variable that is available + /// to selected repositories. Organization variables that are available to selected + /// repositories have their `visibility` field set to `selected`. /// /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. - public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. + public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateOrgVariable.id, + forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/variables/{}/repositories", parameters: [ input.path.org, input.path.name @@ -6150,7 +7305,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? @@ -6168,6 +7323,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -6180,31 +7337,33 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization variable + /// Add selected repository to an organization variable /// - /// Deletes an organization variable using the variable name. + /// Adds a repository to an organization variable that is available to selected repositories. + /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. - public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. + public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteOrgVariable.id, + forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/variables/{}/repositories/{}", parameters: [ input.path.org, - input.path.name + input.path.name, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) return (request, nil) @@ -6213,6 +7372,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -6225,27 +7386,76 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories for an organization variable + /// Remove selected repository from an organization variable /// - /// Lists all repositories that can access an organization variable - /// that is available to selected repositories. + /// Removes a repository from an organization variable that is + /// available to selected repositories. Organization variables that are available to + /// selected repositories have their `visibility` field set to `selected`. /// /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. - public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. + public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/orgs/{}/actions/variables/{}/repositories/{}", parameters: [ input.path.org, - input.path.name + input.path.name, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List artifacts for a repository + /// + /// Lists all artifacts for a repository. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. + public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListArtifactsForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts", + parameters: [ + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6253,6 +7463,13 @@ 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, @@ -6264,8 +7481,8 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "name", + value: input.query.name ) converter.setAcceptHeader( in: &request.headerFields, @@ -6276,8 +7493,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + let body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6287,7 +7509,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -6296,9 +7518,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 409: - return .conflict(.init()) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -6311,52 +7534,107 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for an organization variable + /// Get an artifact /// - /// Replaces all repositories for an organization variable that is available - /// to selected repositories. Organization variables that are available to selected - /// repositories have their `visibility` field set to `selected`. + /// Gets a specific artifact for a workflow run. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. - public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. + public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsGetArtifact.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/repos/{}/{}/actions/artifacts/{}", parameters: [ - input.path.org, - input.path.name + input.path.owner, + input.path.repo, + input.path.artifactId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetArtifact.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Artifact.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an artifact + /// + /// Deletes an artifact for a workflow run. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. + public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteArtifact.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.artifactId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -6369,43 +7647,71 @@ public struct Client: APIProtocol { } ) } - /// Add selected repository to an organization variable - /// - /// Adds a repository to an organization variable that is available to selected repositories. - /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// Download an artifact /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + /// the response header to find the URL for the download. The `:archive_format` must be `zip`. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. - public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. + public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, + forOperation: Operations.ActionsDownloadArtifact.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", + template: "/repos/{}/{}/actions/artifacts/{}/{}", parameters: [ - input.path.org, - input.path.name, - input.path.repositoryId + input.path.owner, + input.path.repo, + input.path.artifactId, + input.path.archiveFormat ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 409: - return .conflict(.init()) + case 302: + let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Components.Headers.Location.self + )) + return .found(.init(headers: headers)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6418,44 +7724,106 @@ public struct Client: APIProtocol { } ) } - /// Remove selected repository from an organization variable - /// - /// Removes a repository from an organization variable that is - /// available to selected repositories. Organization variables that are available to - /// selected repositories have their `visibility` field set to `selected`. + /// Get GitHub Actions cache retention limit for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Gets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. - public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)`. + public func actionsGetActionsCacheRetentionLimitForRepository(_ input: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, + forOperation: Operations.ActionsGetActionsCacheRetentionLimitForRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", + template: "/repos/{}/{}/actions/cache/retention-limit", parameters: [ - input.path.org, - input.path.name, - input.path.repositoryId + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 409: - return .conflict(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetActionsCacheRetentionLimitForRepository.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.ActionsCacheRetentionLimitForRepository.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6468,23 +7836,22 @@ public struct Client: APIProtocol { } ) } - /// List artifacts for a repository - /// - /// Lists all artifacts for a repository. + /// Set GitHub Actions cache retention limit for a repository /// - /// Anyone with read access to the repository can use this endpoint. + /// Sets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. - public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)`. + public func actionsSetActionsCacheRetentionLimitForRepository(_ input: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsListArtifactsForRepo.id, + forOperation: Operations.ActionsSetActionsCacheRetentionLimitForRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts", + template: "/repos/{}/{}/actions/cache/retention-limit", parameters: [ input.path.owner, input.path.repo @@ -6492,46 +7859,62 @@ public struct Client: APIProtocol { ) 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 - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "name", - value: input.query.name - ) 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.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6541,7 +7924,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -6550,10 +7933,29 @@ 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)) default: return .undocumented( statusCode: response.status.code, @@ -6566,27 +7968,25 @@ public struct Client: APIProtocol { } ) } - /// Get an artifact - /// - /// Gets a specific artifact for a workflow run. + /// Get GitHub Actions cache storage limit for a repository /// - /// Anyone with read access to the repository can use this endpoint. + /// Gets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. - public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)`. + public func actionsGetActionsCacheStorageLimitForRepository(_ input: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetArtifact.id, + forOperation: Operations.ActionsGetActionsCacheStorageLimitForRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", + template: "/repos/{}/{}/actions/cache/storage-limit", parameters: [ input.path.owner, - input.path.repo, - input.path.artifactId + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6604,7 +8004,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetArtifact.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheStorageLimitForRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6614,7 +8014,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Artifact.self, + Components.Schemas.ActionsCacheStorageLimitForRepository.self, from: responseBody, transforming: { value in .json(value) @@ -6624,49 +8024,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + 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" + ] ) - } - } - ) - } - /// Delete an artifact - /// - /// Deletes an artifact for a workflow run. - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. - public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteArtifact.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.artifactId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + 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, @@ -6679,52 +8080,85 @@ public struct Client: APIProtocol { } ) } - /// Download an artifact + /// Set GitHub Actions cache storage limit for a repository /// - /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in - /// the response header to find the URL for the download. The `:archive_format` must be `zip`. + /// Sets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. - public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)`. + public func actionsSetActionsCacheStorageLimitForRepository(_ input: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsDownloadArtifact.id, + forOperation: Operations.ActionsSetActionsCacheStorageLimitForRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}/{}", + template: "/repos/{}/{}/actions/cache/storage-limit", parameters: [ input.path.owner, - input.path.repo, - input.path.artifactId, - input.path.archiveFormat + input.path.repo ] ) 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 302: - let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Components.Headers.Location.self - )) - return .found(.init(headers: headers)) - case 410: + case 204: + return .noContent(.init()) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6743,7 +8177,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -10477,6 +11933,13 @@ public struct Client: APIProtocol { name: "name", value: input.query.name ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -12569,6 +14032,10 @@ public struct Client: APIProtocol { method: .post ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -12584,6 +14051,28 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateWorkflowDispatch.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.WorkflowDispatchResponse.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 6323cc65d3..5e867feda2 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -11,6 +11,86 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get GitHub Actions cache retention limit for an enterprise + /// + /// Gets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)`. + func actionsGetActionsCacheRetentionLimitForEnterprise(_ input: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Output + /// Set GitHub Actions cache retention limit for an enterprise + /// + /// Sets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)`. + func actionsSetActionsCacheRetentionLimitForEnterprise(_ input: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Output + /// Get GitHub Actions cache storage limit for an enterprise + /// + /// Gets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)`. + func actionsGetActionsCacheStorageLimitForEnterprise(_ input: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output + /// Set GitHub Actions cache storage limit for an enterprise + /// + /// Sets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)`. + func actionsSetActionsCacheStorageLimitForEnterprise(_ input: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Output + /// Get GitHub Actions cache retention limit for an organization + /// + /// Gets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-organization)`. + func actionsGetActionsCacheRetentionLimitForOrganization(_ input: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output + /// Set GitHub Actions cache retention limit for an organization + /// + /// Sets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)`. + func actionsSetActionsCacheRetentionLimitForOrganization(_ input: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Output + /// Get GitHub Actions cache storage limit for an organization + /// + /// Gets GitHub Actions cache storage limit for an organization. All repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-organization)`. + func actionsGetActionsCacheStorageLimitForOrganization(_ input: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output + /// Set GitHub Actions cache storage limit for an organization + /// + /// Sets GitHub Actions cache storage limit for an organization. All organizations and repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)`. + func actionsSetActionsCacheStorageLimitForOrganization(_ input: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForOrganization.Output /// Get GitHub Actions cache usage for an organization /// /// Gets the total GitHub Actions cache usage for an organization. @@ -890,6 +970,46 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output + /// Get GitHub Actions cache retention limit for a repository + /// + /// Gets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)`. + func actionsGetActionsCacheRetentionLimitForRepository(_ input: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForRepository.Output + /// Set GitHub Actions cache retention limit for a repository + /// + /// Sets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)`. + func actionsSetActionsCacheRetentionLimitForRepository(_ input: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForRepository.Output + /// Get GitHub Actions cache storage limit for a repository + /// + /// Gets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)`. + func actionsGetActionsCacheStorageLimitForRepository(_ input: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input) async throws -> Operations.ActionsGetActionsCacheStorageLimitForRepository.Output + /// Set GitHub Actions cache storage limit for a repository + /// + /// Sets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)`. + func actionsSetActionsCacheStorageLimitForRepository(_ input: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input) async throws -> Operations.ActionsSetActionsCacheStorageLimitForRepository.Output /// Get GitHub Actions cache usage for a repository /// /// Gets GitHub Actions cache usage for a repository. @@ -1814,6 +1934,158 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get GitHub Actions cache retention limit for an enterprise + /// + /// Gets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)`. + public func actionsGetActionsCacheRetentionLimitForEnterprise( + path: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Output { + try await actionsGetActionsCacheRetentionLimitForEnterprise(Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache retention limit for an enterprise + /// + /// Sets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)`. + public func actionsSetActionsCacheRetentionLimitForEnterprise( + path: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Output { + try await actionsSetActionsCacheRetentionLimitForEnterprise(Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get GitHub Actions cache storage limit for an enterprise + /// + /// Gets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)`. + public func actionsGetActionsCacheStorageLimitForEnterprise( + path: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output { + try await actionsGetActionsCacheStorageLimitForEnterprise(Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache storage limit for an enterprise + /// + /// Sets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)`. + public func actionsSetActionsCacheStorageLimitForEnterprise( + path: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Output { + try await actionsSetActionsCacheStorageLimitForEnterprise(Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get GitHub Actions cache retention limit for an organization + /// + /// Gets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-organization)`. + public func actionsGetActionsCacheRetentionLimitForOrganization( + path: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output { + try await actionsGetActionsCacheRetentionLimitForOrganization(Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache retention limit for an organization + /// + /// Sets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)`. + public func actionsSetActionsCacheRetentionLimitForOrganization( + path: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Output { + try await actionsSetActionsCacheRetentionLimitForOrganization(Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get GitHub Actions cache storage limit for an organization + /// + /// Gets GitHub Actions cache storage limit for an organization. All repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-organization)`. + public func actionsGetActionsCacheStorageLimitForOrganization( + path: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output { + try await actionsGetActionsCacheStorageLimitForOrganization(Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache storage limit for an organization + /// + /// Sets GitHub Actions cache storage limit for an organization. All organizations and repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)`. + public func actionsSetActionsCacheStorageLimitForOrganization( + path: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheStorageLimitForOrganization.Output { + try await actionsSetActionsCacheStorageLimitForOrganization(Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input( + path: path, + headers: headers, + body: body + )) + } /// Get GitHub Actions cache usage for an organization /// /// Gets the total GitHub Actions cache usage for an organization. @@ -3357,6 +3629,82 @@ extension APIProtocol { headers: headers )) } + /// Get GitHub Actions cache retention limit for a repository + /// + /// Gets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)`. + public func actionsGetActionsCacheRetentionLimitForRepository( + path: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheRetentionLimitForRepository.Output { + try await actionsGetActionsCacheRetentionLimitForRepository(Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache retention limit for a repository + /// + /// Sets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)`. + public func actionsSetActionsCacheRetentionLimitForRepository( + path: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheRetentionLimitForRepository.Output { + try await actionsSetActionsCacheRetentionLimitForRepository(Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get GitHub Actions cache storage limit for a repository + /// + /// Gets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)`. + public func actionsGetActionsCacheStorageLimitForRepository( + path: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheStorageLimitForRepository.Output { + try await actionsGetActionsCacheStorageLimitForRepository(Operations.ActionsGetActionsCacheStorageLimitForRepository.Input( + path: path, + headers: headers + )) + } + /// Set GitHub Actions cache storage limit for a repository + /// + /// Sets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)`. + public func actionsSetActionsCacheStorageLimitForRepository( + path: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Body + ) async throws -> Operations.ActionsSetActionsCacheStorageLimitForRepository.Output { + try await actionsSetActionsCacheStorageLimitForRepository(Operations.ActionsSetActionsCacheStorageLimitForRepository.Input( + path: path, + headers: headers, + body: body + )) + } /// Get GitHub Actions cache usage for a repository /// /// Gets GitHub Actions cache usage for a repository. @@ -4693,10 +5041,12 @@ extension APIProtocol { /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/post(actions/create-workflow-dispatch)`. public func actionsCreateWorkflowDispatch( path: Operations.ActionsCreateWorkflowDispatch.Input.Path, + headers: Operations.ActionsCreateWorkflowDispatch.Input.Headers = .init(), body: Operations.ActionsCreateWorkflowDispatch.Input.Body ) async throws -> Operations.ActionsCreateWorkflowDispatch.Output { try await actionsCreateWorkflowDispatch(Operations.ActionsCreateWorkflowDispatch.Input( path: path, + headers: headers, body: body )) } @@ -5345,8 +5695,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -5371,7 +5721,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -5844,6 +6194,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -6089,6 +6458,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -6186,6 +6558,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -6283,6 +6658,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -6381,6 +6759,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -6452,6 +6833,44 @@ public enum Components { case htmlUrl = "html_url" } } + /// GitHub Actions cache retention policy for an enterprise. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-enterprise`. + public struct ActionsCacheRetentionLimitForEnterprise: Codable, Hashable, Sendable { + /// For repositories & organizations in an enterprise, the maximum duration, in days, for which caches in a repository may be retained. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-enterprise/max_cache_retention_days`. + public var maxCacheRetentionDays: Swift.Int? + /// Creates a new `ActionsCacheRetentionLimitForEnterprise`. + /// + /// - Parameters: + /// - maxCacheRetentionDays: For repositories & organizations in an enterprise, the maximum duration, in days, for which caches in a repository may be retained. + public init(maxCacheRetentionDays: Swift.Int? = nil) { + self.maxCacheRetentionDays = maxCacheRetentionDays + } + public enum CodingKeys: String, CodingKey { + case maxCacheRetentionDays = "max_cache_retention_days" + } + } + /// GitHub Actions cache storage policy for an enterprise. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-enterprise`. + public struct ActionsCacheStorageLimitForEnterprise: Codable, Hashable, Sendable { + /// For repositories & organizations in an enterprise, the maximum size limit for the sum of all caches in a repository, in gigabytes. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-enterprise/max_cache_size_gb`. + public var maxCacheSizeGb: Swift.Int? + /// Creates a new `ActionsCacheStorageLimitForEnterprise`. + /// + /// - Parameters: + /// - maxCacheSizeGb: For repositories & organizations in an enterprise, the maximum size limit for the sum of all caches in a repository, in gigabytes. + public init(maxCacheSizeGb: Swift.Int? = nil) { + self.maxCacheSizeGb = maxCacheSizeGb + } + public enum CodingKeys: String, CodingKey { + case maxCacheSizeGb = "max_cache_size_gb" + } + } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-integration`. @@ -6474,8 +6893,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -6494,7 +6913,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -6566,7 +6985,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -6596,7 +7015,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -6698,6 +7117,163 @@ public enum Components { case installationsCount = "installations_count" } } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. + public struct PullRequestMinimal: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public var head: Components.Schemas.PullRequestMinimal.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public var base: Components.Schemas.PullRequestMinimal.BasePayload + /// Creates a new `PullRequestMinimal`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - url: + /// - head: + /// - base: + public init( + id: Swift.Int64, + number: Swift.Int, + url: Swift.String, + head: Components.Schemas.PullRequestMinimal.HeadPayload, + base: Components.Schemas.PullRequestMinimal.BasePayload + ) { + self.id = id + self.number = number + self.url = url + self.head = head + self.base = base + } + public enum CodingKeys: String, CodingKey { + case id + case number + case url + case head + case base + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { /// Enable or disable GitHub Advanced Security for the repository. @@ -6872,6 +7448,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -6882,6 +7559,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -6889,7 +7569,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -6898,6 +7581,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -6907,6 +7593,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -7049,6 +7738,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -7184,10 +7888,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -7265,6 +7969,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -7354,6 +8061,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -7443,6 +8153,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -7533,6 +8246,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -7556,6 +8272,44 @@ public enum Components { case customProperties = "custom_properties" } } + /// GitHub Actions cache retention policy for an organization. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-organization`. + public struct ActionsCacheRetentionLimitForOrganization: Codable, Hashable, Sendable { + /// For repositories in this organization, the maximum duration, in days, for which caches in a repository may be retained. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-organization/max_cache_retention_days`. + public var maxCacheRetentionDays: Swift.Int? + /// Creates a new `ActionsCacheRetentionLimitForOrganization`. + /// + /// - Parameters: + /// - maxCacheRetentionDays: For repositories in this organization, the maximum duration, in days, for which caches in a repository may be retained. + public init(maxCacheRetentionDays: Swift.Int? = nil) { + self.maxCacheRetentionDays = maxCacheRetentionDays + } + public enum CodingKeys: String, CodingKey { + case maxCacheRetentionDays = "max_cache_retention_days" + } + } + /// GitHub Actions cache storage policy for an organization. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-organization`. + public struct ActionsCacheStorageLimitForOrganization: Codable, Hashable, Sendable { + /// For repositories in the organization, the maximum size limit for the sum of all caches in a repository, in gigabytes. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-organization/max_cache_size_gb`. + public var maxCacheSizeGb: Swift.Int? + /// Creates a new `ActionsCacheStorageLimitForOrganization`. + /// + /// - Parameters: + /// - maxCacheSizeGb: For repositories in the organization, the maximum size limit for the sum of all caches in a repository, in gigabytes. + public init(maxCacheSizeGb: Swift.Int? = nil) { + self.maxCacheSizeGb = maxCacheSizeGb + } + public enum CodingKeys: String, CodingKey { + case maxCacheSizeGb = "max_cache_size_gb" + } + } /// - 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. @@ -8121,7 +8875,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -9428,6 +10182,44 @@ public enum Components { case workflowRun = "workflow_run" } } + /// GitHub Actions cache retention policy for a repository. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-repository`. + public struct ActionsCacheRetentionLimitForRepository: Codable, Hashable, Sendable { + /// The maximum number of days to keep caches in this repository. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-retention-limit-for-repository/max_cache_retention_days`. + public var maxCacheRetentionDays: Swift.Int? + /// Creates a new `ActionsCacheRetentionLimitForRepository`. + /// + /// - Parameters: + /// - maxCacheRetentionDays: The maximum number of days to keep caches in this repository. + public init(maxCacheRetentionDays: Swift.Int? = nil) { + self.maxCacheRetentionDays = maxCacheRetentionDays + } + public enum CodingKeys: String, CodingKey { + case maxCacheRetentionDays = "max_cache_retention_days" + } + } + /// GitHub Actions cache storage policy for a repository. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-repository`. + public struct ActionsCacheStorageLimitForRepository: Codable, Hashable, Sendable { + /// The maximum total cache size for this repository, in gigabytes. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-storage-limit-for-repository/max_cache_size_gb`. + public var maxCacheSizeGb: Swift.Int? + /// Creates a new `ActionsCacheStorageLimitForRepository`. + /// + /// - Parameters: + /// - maxCacheSizeGb: The maximum total cache size for this repository, in gigabytes. + public init(maxCacheSizeGb: Swift.Int? = nil) { + self.maxCacheSizeGb = maxCacheSizeGb + } + public enum CodingKeys: String, CodingKey { + case maxCacheSizeGb = "max_cache_size_gb" + } + } /// Repository actions caches /// /// - Remark: Generated from `#/components/schemas/actions-cache-list`. @@ -9999,163 +10791,6 @@ public enum Components { case ref } } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. - public struct PullRequestMinimal: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. - public struct RepoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. - public var name: Swift.String - /// Creates a new `RepoPayload`. - /// - /// - Parameters: - /// - id: - /// - url: - /// - name: - public init( - id: Swift.Int64, - url: Swift.String, - name: Swift.String - ) { - self.id = id - self.url = url - self.name = name - } - public enum CodingKeys: String, CodingKey { - case id - case url - case name - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. - public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - ref: - /// - sha: - /// - repo: - public init( - ref: Swift.String, - sha: Swift.String, - repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload - ) { - self.ref = ref - self.sha = sha - self.repo = repo - } - public enum CodingKeys: String, CodingKey { - case ref - case sha - case repo - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. - public var head: Components.Schemas.PullRequestMinimal.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. - public struct RepoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. - public var name: Swift.String - /// Creates a new `RepoPayload`. - /// - /// - Parameters: - /// - id: - /// - url: - /// - name: - public init( - id: Swift.Int64, - url: Swift.String, - name: Swift.String - ) { - self.id = id - self.url = url - self.name = name - } - public enum CodingKeys: String, CodingKey { - case id - case url - case name - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. - public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload - /// Creates a new `BasePayload`. - /// - /// - Parameters: - /// - ref: - /// - sha: - /// - repo: - public init( - ref: Swift.String, - sha: Swift.String, - repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload - ) { - self.ref = ref - self.sha = sha - self.repo = repo - } - public enum CodingKeys: String, CodingKey { - case ref - case sha - case repo - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. - public var base: Components.Schemas.PullRequestMinimal.BasePayload - /// Creates a new `PullRequestMinimal`. - /// - /// - Parameters: - /// - id: - /// - number: - /// - url: - /// - head: - /// - base: - public init( - id: Swift.Int64, - number: Swift.Int, - url: Swift.String, - head: Components.Schemas.PullRequestMinimal.HeadPayload, - base: Components.Schemas.PullRequestMinimal.BasePayload - ) { - self.id = id - self.number = number - self.url = url - self.head = head - self.base = base - } - public enum CodingKeys: String, CodingKey { - case id - case number - case url - case head - case base - } - } /// A commit. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-commit`. @@ -10823,8 +11458,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -10845,7 +11480,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -10941,10 +11576,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -10952,8 +11587,8 @@ public enum Components { case case1(Components.Schemas.Deployment.PayloadPayload.Case1Payload) /// - Remark: Generated from `#/components/schemas/deployment/payload/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -10972,7 +11607,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -11395,6 +12030,43 @@ public enum Components { case deletedAt = "deleted_at" } } + /// The ID of the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/workflow-run-id`. + public typealias WorkflowRunId = Swift.Int64 + /// Response containing the workflow run ID and URLs. + /// + /// - Remark: Generated from `#/components/schemas/workflow-dispatch-response`. + public struct WorkflowDispatchResponse: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/workflow-dispatch-response/workflow_run_id`. + public var workflowRunId: Components.Schemas.WorkflowRunId + /// The URL to the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/workflow-dispatch-response/run_url`. + public var runUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/workflow-dispatch-response/html_url`. + public var htmlUrl: Swift.String + /// Creates a new `WorkflowDispatchResponse`. + /// + /// - Parameters: + /// - workflowRunId: + /// - runUrl: The URL to the workflow run. + /// - htmlUrl: + public init( + workflowRunId: Components.Schemas.WorkflowRunId, + runUrl: Swift.String, + htmlUrl: Swift.String + ) { + self.workflowRunId = workflowRunId + self.runUrl = runUrl + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case workflowRunId = "workflow_run_id" + case runUrl = "run_url" + case htmlUrl = "html_url" + } + } /// Workflow Usage /// /// - Remark: Generated from `#/components/schemas/workflow-usage`. @@ -11504,6 +12176,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. @@ -11659,8 +12335,8 @@ public enum Components { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -11679,7 +12355,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -12112,53 +12788,53 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get GitHub Actions cache usage for an organization + /// Get GitHub Actions cache retention limit for an enterprise /// - /// 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 GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. /// - /// 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:enterprise` 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 /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)`. + public enum ActionsGetActionsCacheRetentionLimitForEnterprise { + public static let id: Swift.String = "actions/get-actions-cache-retention-limit-for-enterprise" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } } - public var path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/header`. + public var path: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/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.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, - headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12166,29 +12842,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/enterprises/{enterprise}/actions/cache/retention-limit/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/enterprises/{enterprise}/actions/cache/retention-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForEnterprise) /// 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.ActionsCacheRetentionLimitForEnterprise { get throws { switch self { case let .json(body): @@ -12198,31 +12860,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + public var body: Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.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.ActionsGetActionsCacheRetentionLimitForEnterprise.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//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok) + case ok(Operations.ActionsGetActionsCacheRetentionLimitForEnterprise.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.ActionsGetActionsCacheRetentionLimitForEnterprise.Output.Ok { get throws { switch self { case let .ok(response): @@ -12235,205 +12892,1760 @@ 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) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List repositories with GitHub Actions cache usage for an organization - /// - /// Lists repositories and their GitHub Actions cache usage for an organization. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. - /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. - public enum ActionsGetActionsCacheUsageByRepoForOrg { - public static let id: Swift.String = "actions/get-actions-cache-usage-by-repo-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.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] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers - /// Creates a new `Input`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)/responses/403`. /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - 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 - } - } - @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`. - @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 - } - } + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } } - /// Response + /// Resource not found /// - /// - 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//enterprises/{enterprise}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-enterprise)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache retention limit for an enterprise + /// + /// Sets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)`. + public enum ActionsSetActionsCacheRetentionLimitForEnterprise { + public static let id: Swift.String = "actions/set-actions-cache-retention-limit-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/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.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/retention-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForEnterprise) + } + public var body: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.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//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheRetentionLimitForEnterprise.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)/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.ActionsSetActionsCacheRetentionLimitForEnterprise.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-enterprise)/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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions cache storage limit for an enterprise + /// + /// Gets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)`. + public enum ActionsGetActionsCacheStorageLimitForEnterprise { + public static let id: Swift.String = "actions/get-actions-cache-storage-limit-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForEnterprise) + /// 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.ActionsCacheStorageLimitForEnterprise { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheStorageLimitForEnterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheStorageLimitForEnterprise.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.ActionsGetActionsCacheStorageLimitForEnterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache storage limit for an enterprise + /// + /// Sets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this + /// enterprise may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)`. + public enum ActionsSetActionsCacheStorageLimitForEnterprise { + public static let id: Swift.String = "actions/set-actions-cache-storage-limit-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/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.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/cache/storage-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForEnterprise) + } + public var body: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForEnterprise.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//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheStorageLimitForEnterprise.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)/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.ActionsSetActionsCacheStorageLimitForEnterprise.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-enterprise)/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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions cache retention limit for an organization + /// + /// Gets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-organization)`. + public enum ActionsGetActionsCacheRetentionLimitForOrganization { + public static let id: Swift.String = "actions/get-actions-cache-retention-limit-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForOrganization) + /// 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.ActionsCacheRetentionLimitForOrganization { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheRetentionLimitForOrganization.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheRetentionLimitForOrganization.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.ActionsGetActionsCacheRetentionLimitForOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-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/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-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) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache retention limit for an organization + /// + /// Sets GitHub Actions cache retention limit for an organization. All repositories under this + /// organization may not set a higher cache retention limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)`. + public enum ActionsSetActionsCacheRetentionLimitForOrganization { + public static let id: Swift.String = "actions/set-actions-cache-retention-limit-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/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.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/retention-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForOrganization) + } + public var body: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForOrganization.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/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheRetentionLimitForOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-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.ActionsSetActionsCacheRetentionLimitForOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-organization)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-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/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions cache storage limit for an organization + /// + /// Gets GitHub Actions cache storage limit for an organization. All repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-organization)`. + public enum ActionsGetActionsCacheStorageLimitForOrganization { + public static let id: Swift.String = "actions/get-actions-cache-storage-limit-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForOrganization) + /// 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.ActionsCacheStorageLimitForOrganization { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheStorageLimitForOrganization.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheStorageLimitForOrganization.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.ActionsGetActionsCacheStorageLimitForOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-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/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-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) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache storage limit for an organization + /// + /// Sets GitHub Actions cache storage limit for an organization. All organizations and repositories under this + /// organization may not set a higher cache storage limit. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)`. + public enum ActionsSetActionsCacheStorageLimitForOrganization { + public static let id: Swift.String = "actions/set-actions-cache-storage-limit-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/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.ActionsSetActionsCacheStorageLimitForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/cache/storage-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForOrganization) + } + public var body: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForOrganization.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForOrganization.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/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheStorageLimitForOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-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.ActionsSetActionsCacheStorageLimitForOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-organization)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-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/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions cache usage for an organization + /// + /// Gets the total GitHub Actions cache usage for an organization. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)`. + public enum ActionsGetActionsCacheUsageForOrg { + public static let id: Swift.String = "actions/get-actions-cache-usage-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, + headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.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.ActionsCacheUsageOrgEnterprise { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response 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( + headers: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)/responses/200`. + /// + /// HTTP response code: `200 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.ActionsGetActionsCacheUsageForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List repositories with GitHub Actions cache usage for an organization + /// + /// Lists repositories and their GitHub Actions cache usage for an organization. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. + public enum ActionsGetActionsCacheUsageByRepoForOrg { + public static let id: Swift.String = "actions/get-actions-cache-usage-by-repo-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.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] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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() + ) { + 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`. + @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 + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", response: self ) } @@ -14700,6 +16912,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/enable_static_ip`. public var enableStaticIp: Swift.Bool? + /// 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/{hosted_runner_id}/PATCH/requestBody/json/size`. + public var size: Swift.String? + /// The unique identifier of the runner image. To list available images, use `GET /actions/hosted-runners/images/github-owned`, `GET /actions/hosted-runners/images/partner`, or `GET /actions/hosted-runners/images/custom`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_id`. + public var imageId: Swift.String? /// The version of the runner image to deploy. This is relevant only for runners using custom images. /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_version`. @@ -14711,18 +16931,24 @@ public enum Operations { /// - 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` + /// - size: The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes` + /// - imageId: The unique identifier of the runner image. To list available images, use `GET /actions/hosted-runners/images/github-owned`, `GET /actions/hosted-runners/images/partner`, or `GET /actions/hosted-runners/images/custom`. /// - imageVersion: The version of the runner image to deploy. This is relevant only for runners using custom images. public init( name: Swift.String? = nil, runnerGroupId: Swift.Int? = nil, maximumRunners: Swift.Int? = nil, enableStaticIp: Swift.Bool? = nil, + size: Swift.String? = nil, + imageId: Swift.String? = nil, imageVersion: Swift.String? = nil ) { self.name = name self.runnerGroupId = runnerGroupId self.maximumRunners = maximumRunners self.enableStaticIp = enableStaticIp + self.size = size + self.imageId = imageId self.imageVersion = imageVersion } public enum CodingKeys: String, CodingKey { @@ -14730,6 +16956,8 @@ public enum Operations { case runnerGroupId = "runner_group_id" case maximumRunners = "maximum_runners" case enableStaticIp = "enable_static_ip" + case size + case imageId = "image_id" case imageVersion = "image_version" } } @@ -26080,6 +28308,810 @@ public enum Operations { } } } + /// Get GitHub Actions cache retention limit for a repository + /// + /// Gets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)`. + public enum ActionsGetActionsCacheRetentionLimitForRepository { + public static let id: Swift.String = "actions/get-actions-cache-retention-limit-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Path, + headers: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForRepository) + /// 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.ActionsCacheRetentionLimitForRepository { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheRetentionLimitForRepository.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheRetentionLimitForRepository.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.ActionsGetActionsCacheRetentionLimitForRepository.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/get(actions/get-actions-cache-retention-limit-for-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache retention limit for a repository + /// + /// Sets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if + /// not manually removed or evicted due to size constraints. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/retention-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)`. + public enum ActionsSetActionsCacheRetentionLimitForRepository { + public static let id: Swift.String = "actions/set-actions-cache-retention-limit-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/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.ActionsSetActionsCacheRetentionLimitForRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/retention-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheRetentionLimitForRepository) + } + public var body: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Path, + headers: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheRetentionLimitForRepository.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//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheRetentionLimitForRepository.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetActionsCacheRetentionLimitForRepository.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/retention-limit/put(actions/set-actions-cache-retention-limit-for-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions cache storage limit for a repository + /// + /// Gets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)`. + public enum ActionsGetActionsCacheStorageLimitForRepository { + public static let id: Swift.String = "actions/get-actions-cache-storage-limit-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Path, + headers: Operations.ActionsGetActionsCacheStorageLimitForRepository.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForRepository) + /// 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.ActionsCacheStorageLimitForRepository { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheStorageLimitForRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheStorageLimitForRepository.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheStorageLimitForRepository.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.ActionsGetActionsCacheStorageLimitForRepository.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/get(actions/get-actions-cache-storage-limit-for-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set GitHub Actions cache storage limit for a repository + /// + /// Sets GitHub Actions cache storage limit for a repository. This determines the maximum size of caches that can be + /// stored before eviction occurs. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:repository` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/cache/storage-limit`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)`. + public enum ActionsSetActionsCacheStorageLimitForRepository { + public static let id: Swift.String = "actions/set-actions-cache-storage-limit-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/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.ActionsSetActionsCacheStorageLimitForRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/storage-limit/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsCacheStorageLimitForRepository) + } + public var body: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Path, + headers: Operations.ActionsSetActionsCacheStorageLimitForRepository.Input.Headers = .init(), + body: Operations.ActionsSetActionsCacheStorageLimitForRepository.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//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetActionsCacheStorageLimitForRepository.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetActionsCacheStorageLimitForRepository.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/storage-limit/put(actions/set-actions-cache-storage-limit-for-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } /// Get GitHub Actions cache usage for a repository /// /// Gets GitHub Actions cache usage for a repository. @@ -33191,20 +36223,32 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts/GET/query/name`. public var name: Components.Parameters.ArtifactName? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts/GET/query/direction`. + public var direction: Components.Parameters.Direction? /// Creates a new `Query`. /// /// - Parameters: /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - name: The name field of an artifact. When specified, only artifacts with this name will be returned. + /// - direction: The direction to sort the results by. public init( perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - name: Components.Parameters.ArtifactName? = nil + name: Components.Parameters.ArtifactName? = nil, + direction: Components.Parameters.Direction? = nil ) { self.perPage = perPage self.page = page self.name = name + self.direction = direction } } public var query: Operations.ActionsListWorkflowRunArtifacts.Input.Query @@ -34141,8 +37185,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -34163,7 +37207,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -37631,8 +40675,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -37651,7 +40695,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -37816,8 +40860,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -37836,7 +40880,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -37945,8 +40989,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -37965,7 +41009,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -37995,6 +41039,18 @@ public enum Operations { } } public var path: Operations.ActionsCreateWorkflowDispatch.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateWorkflowDispatch.Input.Headers /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/json`. @@ -38003,7 +41059,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/json/ref`. public var ref: Swift.String - /// Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. + /// Input keys and values configured in the workflow file. The maximum number of properties is 25. Any default properties configured in the workflow file will be used when `inputs` are omitted. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/json/inputs`. public struct InputsPayload: Codable, Hashable, Sendable { @@ -38016,32 +41072,40 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. + /// Input keys and values configured in the workflow file. The maximum number of properties is 25. Any default properties configured in the workflow file will be used when `inputs` are omitted. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/json/inputs`. public var inputs: Operations.ActionsCreateWorkflowDispatch.Input.Body.JsonPayload.InputsPayload? + /// Whether the response should include the workflow run ID and URLs. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/json/return_run_details`. + public var returnRunDetails: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - ref: The git reference for the workflow. The reference can be a branch or tag name. - /// - inputs: Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. + /// - inputs: Input keys and values configured in the workflow file. The maximum number of properties is 25. Any default properties configured in the workflow file will be used when `inputs` are omitted. + /// - returnRunDetails: Whether the response should include the workflow run ID and URLs. public init( ref: Swift.String, - inputs: Operations.ActionsCreateWorkflowDispatch.Input.Body.JsonPayload.InputsPayload? = nil + inputs: Operations.ActionsCreateWorkflowDispatch.Input.Body.JsonPayload.InputsPayload? = nil, + returnRunDetails: Swift.Bool? = nil ) { self.ref = ref self.inputs = inputs + self.returnRunDetails = returnRunDetails } public enum CodingKeys: String, CodingKey { case ref case inputs + case returnRunDetails = "return_run_details" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/requestBody/content/application\/json`. @@ -38052,12 +41116,15 @@ public enum Operations { /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( path: Operations.ActionsCreateWorkflowDispatch.Input.Path, + headers: Operations.ActionsCreateWorkflowDispatch.Input.Headers = .init(), body: Operations.ActionsCreateWorkflowDispatch.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -38066,13 +41133,13 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// Empty response when `return_run_details` parameter is `false`. /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/post(actions/create-workflow-dispatch)/responses/204`. /// /// HTTP response code: `204 noContent`. case noContent(Operations.ActionsCreateWorkflowDispatch.Output.NoContent) - /// Response + /// Empty response when `return_run_details` parameter is `false`. /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/post(actions/create-workflow-dispatch)/responses/204`. /// @@ -38097,11 +41164,87 @@ public enum Operations { } } } + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/POST/responses/200/content/application\/json`. + case json(Components.Schemas.WorkflowDispatchResponse) + /// 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.WorkflowDispatchResponse { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateWorkflowDispatch.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateWorkflowDispatch.Output.Ok.Body) { + self.body = body + } + } + /// Response including the workflow run ID and URLs when `return_run_details` parameter is `true`. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches/post(actions/create-workflow-dispatch)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsCreateWorkflowDispatch.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.ActionsCreateWorkflowDispatch.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } /// Enable a workflow /// @@ -38130,8 +41273,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -38150,7 +41293,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -38261,8 +41404,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -38281,7 +41424,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -38595,8 +41738,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/workflow-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -38615,7 +41758,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) From 98289432ecd4629047a6d3379b8f953dc735b0fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:04:55 +0000 Subject: [PATCH 03/33] Commit via running: make Sources/activity --- Sources/activity/Types.swift | 4860 ++++++++++++++++++++++++++++------ 1 file changed, 4063 insertions(+), 797 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 40c706a7b4..49268fe9bc 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -1145,8 +1145,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1171,7 +1171,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1644,6 +1644,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1889,6 +1908,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1986,6 +2008,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2083,6 +2108,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2181,6 +2209,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2301,6 +2332,706 @@ public enum Components { case avatarUrl = "avatar_url" } } + /// Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + /// + /// - Remark: Generated from `#/components/schemas/label`. + public struct Label: Codable, Hashable, Sendable { + /// Unique identifier for the label. + /// + /// - Remark: Generated from `#/components/schemas/label/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/label/node_id`. + public var nodeId: Swift.String + /// URL for the label + /// + /// - Remark: Generated from `#/components/schemas/label/url`. + public var url: Swift.String + /// The name of the label. + /// + /// - Remark: Generated from `#/components/schemas/label/name`. + public var name: Swift.String + /// Optional description of the label, such as its purpose. + /// + /// - Remark: Generated from `#/components/schemas/label/description`. + public var description: Swift.String? + /// 6-character hex code, without the leading #, identifying the color + /// + /// - Remark: Generated from `#/components/schemas/label/color`. + public var color: Swift.String + /// Whether this label comes by default in a new repository. + /// + /// - Remark: Generated from `#/components/schemas/label/default`. + public var _default: Swift.Bool + /// Creates a new `Label`. + /// + /// - Parameters: + /// - id: Unique identifier for the label. + /// - nodeId: + /// - url: URL for the label + /// - name: The name of the label. + /// - description: Optional description of the label, such as its purpose. + /// - color: 6-character hex code, without the leading #, identifying the color + /// - _default: Whether this label comes by default in a new repository. + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// A Discussion in a repository. + /// + /// - Remark: Generated from `#/components/schemas/discussion`. + public struct Discussion: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_at`. + public var answerChosenAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by`. + public struct AnswerChosenByPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/avatar_url`. + public var avatarUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/deleted`. + public var deleted: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/followers_url`. + public var followersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/following_url`. + public var followingUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/gists_url`. + public var gistsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/organizations_url`. + public var organizationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/received_events_url`. + public var receivedEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/repos_url`. + public var reposUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/site_admin`. + public var siteAdmin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/starred_url`. + public var starredUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/subscriptions_url`. + public var subscriptionsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case bot = "Bot" + case user = "User" + case organization = "Organization" + } + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/type`. + public var _type: Components.Schemas.Discussion.AnswerChosenByPayload._TypePayload? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `AnswerChosenByPayload`. + /// + /// - Parameters: + /// - avatarUrl: + /// - deleted: + /// - email: + /// - eventsUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - gravatarId: + /// - htmlUrl: + /// - id: + /// - login: + /// - name: + /// - nodeId: + /// - organizationsUrl: + /// - receivedEventsUrl: + /// - reposUrl: + /// - siteAdmin: + /// - starredUrl: + /// - subscriptionsUrl: + /// - _type: + /// - url: + /// - userViewType: + public init( + avatarUrl: Swift.String? = nil, + deleted: Swift.Bool? = nil, + email: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + followersUrl: Swift.String? = nil, + followingUrl: Swift.String? = nil, + gistsUrl: Swift.String? = nil, + gravatarId: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + id: Swift.Int, + login: Swift.String, + name: Swift.String? = nil, + nodeId: Swift.String? = nil, + organizationsUrl: Swift.String? = nil, + receivedEventsUrl: Swift.String? = nil, + reposUrl: Swift.String? = nil, + siteAdmin: Swift.Bool? = nil, + starredUrl: Swift.String? = nil, + subscriptionsUrl: Swift.String? = nil, + _type: Components.Schemas.Discussion.AnswerChosenByPayload._TypePayload? = nil, + url: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.avatarUrl = avatarUrl + self.deleted = deleted + self.email = email + self.eventsUrl = eventsUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.gravatarId = gravatarId + self.htmlUrl = htmlUrl + self.id = id + self.login = login + self.name = name + self.nodeId = nodeId + self.organizationsUrl = organizationsUrl + self.receivedEventsUrl = receivedEventsUrl + self.reposUrl = reposUrl + self.siteAdmin = siteAdmin + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self._type = _type + self.url = url + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case avatarUrl = "avatar_url" + case deleted + case email + case eventsUrl = "events_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case gravatarId = "gravatar_id" + case htmlUrl = "html_url" + case id + case login + case name + case nodeId = "node_id" + case organizationsUrl = "organizations_url" + case receivedEventsUrl = "received_events_url" + case reposUrl = "repos_url" + case siteAdmin = "site_admin" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case _type = "type" + case url + case userViewType = "user_view_type" + } + } + /// - Remark: Generated from `#/components/schemas/discussion/answer_chosen_by`. + public var answerChosenBy: Components.Schemas.Discussion.AnswerChosenByPayload? + /// - Remark: Generated from `#/components/schemas/discussion/answer_html_url`. + public var answerHtmlUrl: Swift.String? + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/discussion/author_association`. + @frozen public enum AuthorAssociationPayload: String, Codable, Hashable, Sendable, CaseIterable { + case collaborator = "COLLABORATOR" + case contributor = "CONTRIBUTOR" + case firstTimer = "FIRST_TIMER" + case firstTimeContributor = "FIRST_TIME_CONTRIBUTOR" + case mannequin = "MANNEQUIN" + case member = "MEMBER" + case none = "NONE" + case owner = "OWNER" + } + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/discussion/author_association`. + public var authorAssociation: Components.Schemas.Discussion.AuthorAssociationPayload? + /// - Remark: Generated from `#/components/schemas/discussion/body`. + public var body: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/category`. + public struct CategoryPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion/category/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/discussion/category/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/category/emoji`. + public var emoji: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/category/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/category/is_answerable`. + public var isAnswerable: Swift.Bool + /// - Remark: Generated from `#/components/schemas/discussion/category/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/category/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/category/repository_id`. + public var repositoryId: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/category/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/category/updated_at`. + public var updatedAt: Swift.String + /// Creates a new `CategoryPayload`. + /// + /// - Parameters: + /// - createdAt: + /// - description: + /// - emoji: + /// - id: + /// - isAnswerable: + /// - name: + /// - nodeId: + /// - repositoryId: + /// - slug: + /// - updatedAt: + public init( + createdAt: Foundation.Date, + description: Swift.String, + emoji: Swift.String, + id: Swift.Int, + isAnswerable: Swift.Bool, + name: Swift.String, + nodeId: Swift.String? = nil, + repositoryId: Swift.Int, + slug: Swift.String, + updatedAt: Swift.String + ) { + self.createdAt = createdAt + self.description = description + self.emoji = emoji + self.id = id + self.isAnswerable = isAnswerable + self.name = name + self.nodeId = nodeId + self.repositoryId = repositoryId + self.slug = slug + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case createdAt = "created_at" + case description + case emoji + case id + case isAnswerable = "is_answerable" + case name + case nodeId = "node_id" + case repositoryId = "repository_id" + case slug + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/components/schemas/discussion/category`. + public var category: Components.Schemas.Discussion.CategoryPayload + /// - Remark: Generated from `#/components/schemas/discussion/comments`. + public var comments: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/discussion/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/discussion/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions`. + public struct ReactionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion/reactions/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/rocket`. + public var rocket: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/discussion/reactions/url`. + public var url: Swift.String + /// Creates a new `ReactionsPayload`. + /// + /// - Parameters: + /// - _plus_1: + /// - _hyphen_1: + /// - confused: + /// - eyes: + /// - heart: + /// - hooray: + /// - laugh: + /// - rocket: + /// - totalCount: + /// - url: + public init( + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + confused: Swift.Int, + eyes: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + laugh: Swift.Int, + rocket: Swift.Int, + totalCount: Swift.Int, + url: Swift.String + ) { + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.confused = confused + self.eyes = eyes + self.heart = heart + self.hooray = hooray + self.laugh = laugh + self.rocket = rocket + self.totalCount = totalCount + self.url = url + } + public enum CodingKeys: String, CodingKey { + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case confused + case eyes + case heart + case hooray + case laugh + case rocket + case totalCount = "total_count" + case url + } + } + /// - Remark: Generated from `#/components/schemas/discussion/reactions`. + public var reactions: Components.Schemas.Discussion.ReactionsPayload? + /// - Remark: Generated from `#/components/schemas/discussion/repository_url`. + public var repositoryUrl: Swift.String + /// The current state of the discussion. + /// `converting` means that the discussion is being converted from an issue. + /// `transferring` means that the discussion is being transferred from another repository. + /// + /// - Remark: Generated from `#/components/schemas/discussion/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case locked = "locked" + case converting = "converting" + case transferring = "transferring" + } + /// The current state of the discussion. + /// `converting` means that the discussion is being converted from an issue. + /// `transferring` means that the discussion is being transferred from another repository. + /// + /// - Remark: Generated from `#/components/schemas/discussion/state`. + public var state: Components.Schemas.Discussion.StatePayload + /// The reason for the current state + /// + /// - Remark: Generated from `#/components/schemas/discussion/state_reason`. + @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case resolved = "resolved" + case outdated = "outdated" + case duplicate = "duplicate" + case reopened = "reopened" + } + /// The reason for the current state + /// + /// - Remark: Generated from `#/components/schemas/discussion/state_reason`. + public var stateReason: Components.Schemas.Discussion.StateReasonPayload? + /// - Remark: Generated from `#/components/schemas/discussion/timeline_url`. + public var timelineUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/discussion/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion/user/avatar_url`. + public var avatarUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/deleted`. + public var deleted: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/discussion/user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/followers_url`. + public var followersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/following_url`. + public var followingUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/gists_url`. + public var gistsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/discussion/user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion/user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/organizations_url`. + public var organizationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/received_events_url`. + public var receivedEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/repos_url`. + public var reposUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/site_admin`. + public var siteAdmin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/discussion/user/starred_url`. + public var starredUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/subscriptions_url`. + public var subscriptionsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case bot = "Bot" + case user = "User" + case organization = "Organization" + } + /// - Remark: Generated from `#/components/schemas/discussion/user/type`. + public var _type: Components.Schemas.Discussion.UserPayload._TypePayload? + /// - Remark: Generated from `#/components/schemas/discussion/user/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/discussion/user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - avatarUrl: + /// - deleted: + /// - email: + /// - eventsUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - gravatarId: + /// - htmlUrl: + /// - id: + /// - login: + /// - name: + /// - nodeId: + /// - organizationsUrl: + /// - receivedEventsUrl: + /// - reposUrl: + /// - siteAdmin: + /// - starredUrl: + /// - subscriptionsUrl: + /// - _type: + /// - url: + /// - userViewType: + public init( + avatarUrl: Swift.String? = nil, + deleted: Swift.Bool? = nil, + email: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + followersUrl: Swift.String? = nil, + followingUrl: Swift.String? = nil, + gistsUrl: Swift.String? = nil, + gravatarId: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + id: Swift.Int64, + login: Swift.String, + name: Swift.String? = nil, + nodeId: Swift.String? = nil, + organizationsUrl: Swift.String? = nil, + receivedEventsUrl: Swift.String? = nil, + reposUrl: Swift.String? = nil, + siteAdmin: Swift.Bool? = nil, + starredUrl: Swift.String? = nil, + subscriptionsUrl: Swift.String? = nil, + _type: Components.Schemas.Discussion.UserPayload._TypePayload? = nil, + url: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.avatarUrl = avatarUrl + self.deleted = deleted + self.email = email + self.eventsUrl = eventsUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.gravatarId = gravatarId + self.htmlUrl = htmlUrl + self.id = id + self.login = login + self.name = name + self.nodeId = nodeId + self.organizationsUrl = organizationsUrl + self.receivedEventsUrl = receivedEventsUrl + self.reposUrl = reposUrl + self.siteAdmin = siteAdmin + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self._type = _type + self.url = url + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case avatarUrl = "avatar_url" + case deleted + case email + case eventsUrl = "events_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case gravatarId = "gravatar_id" + case htmlUrl = "html_url" + case id + case login + case name + case nodeId = "node_id" + case organizationsUrl = "organizations_url" + case receivedEventsUrl = "received_events_url" + case reposUrl = "repos_url" + case siteAdmin = "site_admin" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case _type = "type" + case url + case userViewType = "user_view_type" + } + } + /// - Remark: Generated from `#/components/schemas/discussion/user`. + public var user: Components.Schemas.Discussion.UserPayload? + /// - Remark: Generated from `#/components/schemas/discussion/labels`. + public var labels: [Components.Schemas.Label]? + /// Creates a new `Discussion`. + /// + /// - Parameters: + /// - activeLockReason: + /// - answerChosenAt: + /// - answerChosenBy: + /// - answerHtmlUrl: + /// - authorAssociation: How the author is associated with the repository. + /// - body: + /// - category: + /// - comments: + /// - createdAt: + /// - htmlUrl: + /// - id: + /// - locked: + /// - nodeId: + /// - number: + /// - reactions: + /// - repositoryUrl: + /// - state: The current state of the discussion. + /// - stateReason: The reason for the current state + /// - timelineUrl: + /// - title: + /// - updatedAt: + /// - user: + /// - labels: + public init( + activeLockReason: Swift.String? = nil, + answerChosenAt: Swift.String? = nil, + answerChosenBy: Components.Schemas.Discussion.AnswerChosenByPayload? = nil, + answerHtmlUrl: Swift.String? = nil, + authorAssociation: Components.Schemas.Discussion.AuthorAssociationPayload? = nil, + body: Swift.String, + category: Components.Schemas.Discussion.CategoryPayload, + comments: Swift.Int, + createdAt: Foundation.Date, + htmlUrl: Swift.String, + id: Swift.Int, + locked: Swift.Bool, + nodeId: Swift.String, + number: Swift.Int, + reactions: Components.Schemas.Discussion.ReactionsPayload? = nil, + repositoryUrl: Swift.String, + state: Components.Schemas.Discussion.StatePayload, + stateReason: Components.Schemas.Discussion.StateReasonPayload? = nil, + timelineUrl: Swift.String? = nil, + title: Swift.String, + updatedAt: Foundation.Date, + user: Components.Schemas.Discussion.UserPayload? = nil, + labels: [Components.Schemas.Label]? = nil + ) { + self.activeLockReason = activeLockReason + self.answerChosenAt = answerChosenAt + self.answerChosenBy = answerChosenBy + self.answerHtmlUrl = answerHtmlUrl + self.authorAssociation = authorAssociation + self.body = body + self.category = category + self.comments = comments + self.createdAt = createdAt + self.htmlUrl = htmlUrl + self.id = id + self.locked = locked + self.nodeId = nodeId + self.number = number + self.reactions = reactions + self.repositoryUrl = repositoryUrl + self.state = state + self.stateReason = stateReason + self.timelineUrl = timelineUrl + self.title = title + self.updatedAt = updatedAt + self.user = user + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case activeLockReason = "active_lock_reason" + case answerChosenAt = "answer_chosen_at" + case answerChosenBy = "answer_chosen_by" + case answerHtmlUrl = "answer_html_url" + case authorAssociation = "author_association" + case body + case category + case comments + case createdAt = "created_at" + case htmlUrl = "html_url" + case id + case locked + case nodeId = "node_id" + case number + case reactions + case repositoryUrl = "repository_url" + case state + case stateReason = "state_reason" + case timelineUrl = "timeline_url" + case title + case updatedAt = "updated_at" + case user + case labels + } + } /// A collection of related issues and pull requests. /// /// - Remark: Generated from `#/components/schemas/nullable-milestone`. @@ -2535,8 +3266,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -2555,7 +3286,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -2627,7 +3358,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -2657,7 +3388,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -2872,17 +3603,151 @@ public enum Components { case percentCompleted = "percent_completed" } } - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. - public struct IssueDependenciesSummary: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. - public var blockedBy: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. - public var blocking: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. - public var totalBlockedBy: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. - public var totalBlocking: Swift.Int - /// Creates a new `IssueDependenciesSummary`. + /// Context around who pinned an issue comment and when it was pinned. + /// + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment`. + public struct NullablePinnedIssueComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_at`. + public var pinnedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_by`. + public var pinnedBy: Components.Schemas.NullableSimpleUser? + /// Creates a new `NullablePinnedIssueComment`. + /// + /// - Parameters: + /// - pinnedAt: + /// - pinnedBy: + public init( + pinnedAt: Foundation.Date, + pinnedBy: Components.Schemas.NullableSimpleUser? = nil + ) { + self.pinnedAt = pinnedAt + self.pinnedBy = pinnedBy + } + public enum CodingKeys: String, CodingKey { + case pinnedAt = "pinned_at" + case pinnedBy = "pinned_by" + } + } + /// Comments provide a way for people to collaborate on an issue. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment`. + public struct NullableIssueComment: Codable, Hashable, Sendable { + /// Unique identifier of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/node_id`. + public var nodeId: Swift.String + /// URL for the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/url`. + public var url: Swift.String + /// Contents of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? + /// Creates a new `NullableIssueComment`. + /// + /// - Parameters: + /// - id: Unique identifier of the issue comment + /// - nodeId: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment + /// - bodyText: + /// - bodyHtml: + /// - htmlUrl: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - issueUrl: + /// - authorAssociation: + /// - performedViaGithubApp: + /// - reactions: + /// - pin: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + bodyText: Swift.String? = nil, + bodyHtml: Swift.String? = nil, + htmlUrl: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + issueUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.body = body + self.bodyText = bodyText + self.bodyHtml = bodyHtml + self.htmlUrl = htmlUrl + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + self.issueUrl = issueUrl + self.authorAssociation = authorAssociation + self.performedViaGithubApp = performedViaGithubApp + self.reactions = reactions + self.pin = pin + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case body + case bodyText = "body_text" + case bodyHtml = "body_html" + case htmlUrl = "html_url" + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + case issueUrl = "issue_url" + case authorAssociation = "author_association" + case performedViaGithubApp = "performed_via_github_app" + case reactions + case pin + } + } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. /// /// - Parameters: /// - blockedBy: @@ -2955,8 +3820,8 @@ public enum Components { self.value2 = value2 self.value3 = value3 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -2983,7 +3848,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2, @@ -3177,8 +4042,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. case case2(Components.Schemas.Issue.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -3197,7 +4062,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -3301,6 +4166,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pinned_comment`. + public var pinnedComment: Components.Schemas.NullableIssueComment? /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. @@ -3345,6 +4212,7 @@ public enum Components { /// - reactions: /// - subIssuesSummary: /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - pinnedComment: /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -3385,6 +4253,7 @@ public enum Components { reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, parentIssueUrl: Swift.String? = nil, + pinnedComment: Components.Schemas.NullableIssueComment? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -3425,6 +4294,7 @@ public enum Components { self.reactions = reactions self.subIssuesSummary = subIssuesSummary self.parentIssueUrl = parentIssueUrl + self.pinnedComment = pinnedComment self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -3466,6 +4336,7 @@ public enum Components { case reactions case subIssuesSummary = "sub_issues_summary" case parentIssueUrl = "parent_issue_url" + case pinnedComment = "pinned_comment" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -3503,11 +4374,13 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue-comment/issue_url`. public var issueUrl: Swift.String /// - Remark: Generated from `#/components/schemas/issue-comment/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue-comment/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue-comment/reactions`. public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? /// Creates a new `IssueComment`. /// /// - Parameters: @@ -3525,6 +4398,7 @@ public enum Components { /// - authorAssociation: /// - performedViaGithubApp: /// - reactions: + /// - pin: public init( id: Swift.Int64, nodeId: Swift.String, @@ -3537,9 +4411,10 @@ public enum Components { createdAt: Foundation.Date, updatedAt: Foundation.Date, issueUrl: Swift.String, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - reactions: Components.Schemas.ReactionRollup? = nil + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil ) { self.id = id self.nodeId = nodeId @@ -3555,6 +4430,7 @@ public enum Components { self.authorAssociation = authorAssociation self.performedViaGithubApp = performedViaGithubApp self.reactions = reactions + self.pin = pin } public enum CodingKeys: String, CodingKey { case id @@ -3571,545 +4447,1181 @@ public enum Components { case authorAssociation = "author_association" case performedViaGithubApp = "performed_via_github_app" case reactions + case pin } } - /// Event - /// - /// - Remark: Generated from `#/components/schemas/event`. - public struct Event: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/event/id`. - public var id: Swift.String - /// - Remark: Generated from `#/components/schemas/event/type`. - public var _type: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/actor`. - public var actor: Components.Schemas.Actor - /// - Remark: Generated from `#/components/schemas/event/repo`. - public struct RepoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/event/repo/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/event/repo/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/event/repo/url`. - public var url: Swift.String - /// Creates a new `RepoPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. + public struct PullRequestMinimal: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + /// Creates a new `HeadPayload`. /// /// - Parameters: - /// - id: - /// - name: - /// - url: + /// - ref: + /// - sha: + /// - repo: public init( - id: Swift.Int, - name: Swift.String, - url: Swift.String + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload ) { - self.id = id - self.name = name - self.url = url + self.ref = ref + self.sha = sha + self.repo = repo } public enum CodingKeys: String, CodingKey { - case id - case name - case url - } - } - /// - Remark: Generated from `#/components/schemas/event/repo`. - public var repo: Components.Schemas.Event.RepoPayload - /// - Remark: Generated from `#/components/schemas/event/org`. - public var org: Components.Schemas.Actor? - /// - Remark: Generated from `#/components/schemas/event/payload`. - public struct PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/event/payload/action`. - public var action: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/issue`. - public var issue: Components.Schemas.Issue? - /// - Remark: Generated from `#/components/schemas/event/payload/comment`. - public var comment: Components.Schemas.IssueComment? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload`. - public struct PagesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/page_name`. - public var pageName: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/title`. - public var title: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/summary`. - public var summary: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/action`. - public var action: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/sha`. - public var sha: Swift.String? - /// - Remark: Generated from `#/components/schemas/event/payload/PagesPayload/html_url`. - public var htmlUrl: Swift.String? - /// Creates a new `PagesPayloadPayload`. + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public var head: Components.Schemas.PullRequestMinimal.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. /// /// - Parameters: - /// - pageName: - /// - title: - /// - summary: - /// - action: - /// - sha: - /// - htmlUrl: + /// - id: + /// - url: + /// - name: public init( - pageName: Swift.String? = nil, - title: Swift.String? = nil, - summary: Swift.String? = nil, - action: Swift.String? = nil, - sha: Swift.String? = nil, - htmlUrl: Swift.String? = nil + id: Swift.Int64, + url: Swift.String, + name: Swift.String ) { - self.pageName = pageName - self.title = title - self.summary = summary - self.action = action - self.sha = sha - self.htmlUrl = htmlUrl + self.id = id + self.url = url + self.name = name } public enum CodingKeys: String, CodingKey { - case pageName = "page_name" - case title - case summary - case action - case sha - case htmlUrl = "html_url" + case id + case url + case name } } - /// - Remark: Generated from `#/components/schemas/event/payload/pages`. - public typealias PagesPayload = [Components.Schemas.Event.PayloadPayload.PagesPayloadPayload] - /// - Remark: Generated from `#/components/schemas/event/payload/pages`. - public var pages: Components.Schemas.Event.PayloadPayload.PagesPayload? - /// Creates a new `PayloadPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + /// Creates a new `BasePayload`. /// /// - Parameters: - /// - action: - /// - issue: - /// - comment: - /// - pages: + /// - ref: + /// - sha: + /// - repo: public init( - action: Swift.String? = nil, - issue: Components.Schemas.Issue? = nil, - comment: Components.Schemas.IssueComment? = nil, - pages: Components.Schemas.Event.PayloadPayload.PagesPayload? = nil + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload ) { - self.action = action - self.issue = issue - self.comment = comment - self.pages = pages + self.ref = ref + self.sha = sha + self.repo = repo } public enum CodingKeys: String, CodingKey { - case action - case issue - case comment - case pages + case ref + case sha + case repo } } - /// - Remark: Generated from `#/components/schemas/event/payload`. - public var payload: Components.Schemas.Event.PayloadPayload - /// - Remark: Generated from `#/components/schemas/event/public`. - public var _public: Swift.Bool - /// - Remark: Generated from `#/components/schemas/event/created_at`. - public var createdAt: Foundation.Date? - /// Creates a new `Event`. + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public var base: Components.Schemas.PullRequestMinimal.BasePayload + /// Creates a new `PullRequestMinimal`. /// /// - Parameters: /// - id: - /// - _type: - /// - actor: - /// - repo: - /// - org: - /// - payload: - /// - _public: - /// - createdAt: + /// - number: + /// - url: + /// - head: + /// - base: public init( - id: Swift.String, - _type: Swift.String? = nil, - actor: Components.Schemas.Actor, - repo: Components.Schemas.Event.RepoPayload, - org: Components.Schemas.Actor? = nil, - payload: Components.Schemas.Event.PayloadPayload, - _public: Swift.Bool, - createdAt: Foundation.Date? = nil + id: Swift.Int64, + number: Swift.Int, + url: Swift.String, + head: Components.Schemas.PullRequestMinimal.HeadPayload, + base: Components.Schemas.PullRequestMinimal.BasePayload ) { self.id = id - self._type = _type - self.actor = actor - self.repo = repo - self.org = org - self.payload = payload - self._public = _public - self.createdAt = createdAt + self.number = number + self.url = url + self.head = head + self.base = base } public enum CodingKeys: String, CodingKey { case id - case _type = "type" - case actor - case repo - case org - case payload - case _public = "public" - case createdAt = "created_at" + case number + case url + case head + case base } } - /// Hypermedia Link with Type + /// Data related to a release. /// - /// - Remark: Generated from `#/components/schemas/link-with-type`. - public struct LinkWithType: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link-with-type/href`. - public var href: Swift.String - /// - Remark: Generated from `#/components/schemas/link-with-type/type`. - public var _type: Swift.String - /// Creates a new `LinkWithType`. + /// - Remark: Generated from `#/components/schemas/release-asset`. + public struct ReleaseAsset: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release-asset/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/browser_download_url`. + public var browserDownloadUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/node_id`. + public var nodeId: Swift.String + /// The file name of the asset. /// - /// - Parameters: - /// - href: - /// - _type: - public init( - href: Swift.String, - _type: Swift.String - ) { - self.href = href - self._type = _type + /// - Remark: Generated from `#/components/schemas/release-asset/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/label`. + public var label: Swift.String? + /// State of the release asset. + /// + /// - Remark: Generated from `#/components/schemas/release-asset/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case uploaded = "uploaded" + case open = "open" } - public enum CodingKeys: String, CodingKey { - case href - case _type = "type" - } - } - /// Feed - /// - /// - Remark: Generated from `#/components/schemas/feed`. - public struct Feed: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/feed/timeline_url`. - public var timelineUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/feed/user_url`. - public var userUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/feed/current_user_public_url`. - public var currentUserPublicUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/feed/current_user_url`. - public var currentUserUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/feed/current_user_actor_url`. - public var currentUserActorUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/feed/current_user_organization_url`. - public var currentUserOrganizationUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/feed/current_user_organization_urls`. - public var currentUserOrganizationUrls: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/feed/security_advisories_url`. - public var securityAdvisoriesUrl: Swift.String? - /// A feed of discussions for a given repository. - /// - /// - Remark: Generated from `#/components/schemas/feed/repository_discussions_url`. - public var repositoryDiscussionsUrl: Swift.String? - /// A feed of discussions for a given repository and category. + /// State of the release asset. /// - /// - Remark: Generated from `#/components/schemas/feed/repository_discussions_category_url`. - public var repositoryDiscussionsCategoryUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/feed/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/feed/_links/timeline`. - public var timeline: Components.Schemas.LinkWithType - /// - Remark: Generated from `#/components/schemas/feed/_links/user`. - public var user: Components.Schemas.LinkWithType - /// - Remark: Generated from `#/components/schemas/feed/_links/security_advisories`. - public var securityAdvisories: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/current_user`. - public var currentUser: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_public`. - public var currentUserPublic: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_actor`. - public var currentUserActor: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_organization`. - public var currentUserOrganization: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_organizations`. - public var currentUserOrganizations: [Components.Schemas.LinkWithType]? - /// - Remark: Generated from `#/components/schemas/feed/_links/repository_discussions`. - public var repositoryDiscussions: Components.Schemas.LinkWithType? - /// - Remark: Generated from `#/components/schemas/feed/_links/repository_discussions_category`. - public var repositoryDiscussionsCategory: Components.Schemas.LinkWithType? - /// Creates a new `_LinksPayload`. - /// - /// - Parameters: - /// - timeline: - /// - user: - /// - securityAdvisories: - /// - currentUser: - /// - currentUserPublic: - /// - currentUserActor: - /// - currentUserOrganization: - /// - currentUserOrganizations: - /// - repositoryDiscussions: - /// - repositoryDiscussionsCategory: - public init( - timeline: Components.Schemas.LinkWithType, - user: Components.Schemas.LinkWithType, - securityAdvisories: Components.Schemas.LinkWithType? = nil, - currentUser: Components.Schemas.LinkWithType? = nil, - currentUserPublic: Components.Schemas.LinkWithType? = nil, - currentUserActor: Components.Schemas.LinkWithType? = nil, - currentUserOrganization: Components.Schemas.LinkWithType? = nil, - currentUserOrganizations: [Components.Schemas.LinkWithType]? = nil, - repositoryDiscussions: Components.Schemas.LinkWithType? = nil, - repositoryDiscussionsCategory: Components.Schemas.LinkWithType? = nil - ) { - self.timeline = timeline - self.user = user - self.securityAdvisories = securityAdvisories - self.currentUser = currentUser - self.currentUserPublic = currentUserPublic - self.currentUserActor = currentUserActor - self.currentUserOrganization = currentUserOrganization - self.currentUserOrganizations = currentUserOrganizations - self.repositoryDiscussions = repositoryDiscussions - self.repositoryDiscussionsCategory = repositoryDiscussionsCategory - } - public enum CodingKeys: String, CodingKey { - case timeline - case user - case securityAdvisories = "security_advisories" - case currentUser = "current_user" - case currentUserPublic = "current_user_public" - case currentUserActor = "current_user_actor" - case currentUserOrganization = "current_user_organization" - case currentUserOrganizations = "current_user_organizations" - case repositoryDiscussions = "repository_discussions" - case repositoryDiscussionsCategory = "repository_discussions_category" - } - } - /// - Remark: Generated from `#/components/schemas/feed/_links`. - public var _links: Components.Schemas.Feed._LinksPayload - /// Creates a new `Feed`. + /// - Remark: Generated from `#/components/schemas/release-asset/state`. + public var state: Components.Schemas.ReleaseAsset.StatePayload + /// - Remark: Generated from `#/components/schemas/release-asset/content_type`. + public var contentType: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/size`. + public var size: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/components/schemas/release-asset/download_count`. + public var downloadCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release-asset/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release-asset/uploader`. + public var uploader: Components.Schemas.NullableSimpleUser? + /// Creates a new `ReleaseAsset`. /// /// - Parameters: - /// - timelineUrl: - /// - userUrl: - /// - currentUserPublicUrl: - /// - currentUserUrl: - /// - currentUserActorUrl: - /// - currentUserOrganizationUrl: - /// - currentUserOrganizationUrls: - /// - securityAdvisoriesUrl: - /// - repositoryDiscussionsUrl: A feed of discussions for a given repository. - /// - repositoryDiscussionsCategoryUrl: A feed of discussions for a given repository and category. - /// - _links: + /// - url: + /// - browserDownloadUrl: + /// - id: + /// - nodeId: + /// - name: The file name of the asset. + /// - label: + /// - state: State of the release asset. + /// - contentType: + /// - size: + /// - digest: + /// - downloadCount: + /// - createdAt: + /// - updatedAt: + /// - uploader: public init( - timelineUrl: Swift.String, - userUrl: Swift.String, - currentUserPublicUrl: Swift.String? = nil, - currentUserUrl: Swift.String? = nil, - currentUserActorUrl: Swift.String? = nil, - currentUserOrganizationUrl: Swift.String? = nil, - currentUserOrganizationUrls: [Swift.String]? = nil, - securityAdvisoriesUrl: Swift.String? = nil, - repositoryDiscussionsUrl: Swift.String? = nil, - repositoryDiscussionsCategoryUrl: Swift.String? = nil, - _links: Components.Schemas.Feed._LinksPayload + url: Swift.String, + browserDownloadUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + label: Swift.String? = nil, + state: Components.Schemas.ReleaseAsset.StatePayload, + contentType: Swift.String, + size: Swift.Int, + digest: Swift.String? = nil, + downloadCount: Swift.Int, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + uploader: Components.Schemas.NullableSimpleUser? = nil ) { - self.timelineUrl = timelineUrl - self.userUrl = userUrl - self.currentUserPublicUrl = currentUserPublicUrl - self.currentUserUrl = currentUserUrl - self.currentUserActorUrl = currentUserActorUrl - self.currentUserOrganizationUrl = currentUserOrganizationUrl - self.currentUserOrganizationUrls = currentUserOrganizationUrls - self.securityAdvisoriesUrl = securityAdvisoriesUrl - self.repositoryDiscussionsUrl = repositoryDiscussionsUrl - self.repositoryDiscussionsCategoryUrl = repositoryDiscussionsCategoryUrl - self._links = _links + self.url = url + self.browserDownloadUrl = browserDownloadUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.label = label + self.state = state + self.contentType = contentType + self.size = size + self.digest = digest + self.downloadCount = downloadCount + self.createdAt = createdAt + self.updatedAt = updatedAt + self.uploader = uploader } public enum CodingKeys: String, CodingKey { - case timelineUrl = "timeline_url" - case userUrl = "user_url" - case currentUserPublicUrl = "current_user_public_url" - case currentUserUrl = "current_user_url" - case currentUserActorUrl = "current_user_actor_url" - case currentUserOrganizationUrl = "current_user_organization_url" - case currentUserOrganizationUrls = "current_user_organization_urls" - case securityAdvisoriesUrl = "security_advisories_url" - case repositoryDiscussionsUrl = "repository_discussions_url" - case repositoryDiscussionsCategoryUrl = "repository_discussions_category_url" - case _links + case url + case browserDownloadUrl = "browser_download_url" + case id + case nodeId = "node_id" + case name + case label + case state + case contentType = "content_type" + case size + case digest + case downloadCount = "download_count" + case createdAt = "created_at" + case updatedAt = "updated_at" + case uploader } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct SecurityAndAnalysis: Codable, Hashable, Sendable { - /// Enable or disable GitHub Advanced Security for the repository. + /// A release. + /// + /// - Remark: Generated from `#/components/schemas/release`. + public struct Release: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/release/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/assets_url`. + public var assetsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/upload_url`. + public var uploadUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/tarball_url`. + public var tarballUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/zipball_url`. + public var zipballUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/release/node_id`. + public var nodeId: Swift.String + /// The name of the tag. /// - /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// - Remark: Generated from `#/components/schemas/release/tag_name`. + public var tagName: Swift.String + /// Specifies the commitish value that determines where the Git tag is created from. /// + /// - Remark: Generated from `#/components/schemas/release/target_commitish`. + public var targetCommitish: Swift.String + /// - Remark: Generated from `#/components/schemas/release/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/body`. + public var body: Swift.String? + /// true to create a draft (unpublished) release, false to create a published one. /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - public var status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? - /// Creates a new `AdvancedSecurityPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// Enable or disable GitHub Advanced Security for the repository. + /// - Remark: Generated from `#/components/schemas/release/draft`. + public var draft: Swift.Bool + /// Whether to identify the release as a prerelease or a full release. /// - /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// - Remark: Generated from `#/components/schemas/release/prerelease`. + public var prerelease: Swift.Bool + /// Whether or not the release is immutable. /// + /// - Remark: Generated from `#/components/schemas/release/immutable`. + public var immutable: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/release/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release/published_at`. + public var publishedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/release/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/release/author`. + public var author: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/release/assets`. + public var assets: [Components.Schemas.ReleaseAsset] + /// - Remark: Generated from `#/components/schemas/release/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/mentions_count`. + public var mentionsCount: Swift.Int? + /// The URL of the release discussion. /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. - public struct CodeSecurityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. - public var status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? - /// Creates a new `CodeSecurityPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. - public var codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? - /// Enable or disable Dependabot security updates for the repository. + /// - Remark: Generated from `#/components/schemas/release/discussion_url`. + public var discussionUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// Creates a new `Release`. /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public struct DependabotSecurityUpdatesPayload: Codable, Hashable, Sendable { - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// The enablement status of Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. - public var status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? - /// Creates a new `DependabotSecurityUpdatesPayload`. - /// - /// - Parameters: - /// - status: The enablement status of Dependabot security updates for the repository. - public init(status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? = nil) { - self.status = status - } - public enum CodingKeys: String, CodingKey { - case status - } + /// - Parameters: + /// - url: + /// - htmlUrl: + /// - assetsUrl: + /// - uploadUrl: + /// - tarballUrl: + /// - zipballUrl: + /// - id: + /// - nodeId: + /// - tagName: The name of the tag. + /// - targetCommitish: Specifies the commitish value that determines where the Git tag is created from. + /// - name: + /// - body: + /// - draft: true to create a draft (unpublished) release, false to create a published one. + /// - prerelease: Whether to identify the release as a prerelease or a full release. + /// - immutable: Whether or not the release is immutable. + /// - createdAt: + /// - publishedAt: + /// - updatedAt: + /// - author: + /// - assets: + /// - bodyHtml: + /// - bodyText: + /// - mentionsCount: + /// - discussionUrl: The URL of the release discussion. + /// - reactions: + public init( + url: Swift.String, + htmlUrl: Swift.String, + assetsUrl: Swift.String, + uploadUrl: Swift.String, + tarballUrl: Swift.String? = nil, + zipballUrl: Swift.String? = nil, + id: Swift.Int, + nodeId: Swift.String, + tagName: Swift.String, + targetCommitish: Swift.String, + name: Swift.String? = nil, + body: Swift.String? = nil, + draft: Swift.Bool, + prerelease: Swift.Bool, + immutable: Swift.Bool? = nil, + createdAt: Foundation.Date, + publishedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + author: Components.Schemas.SimpleUser, + assets: [Components.Schemas.ReleaseAsset], + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil, + mentionsCount: Swift.Int? = nil, + discussionUrl: Swift.String? = nil, + reactions: Components.Schemas.ReactionRollup? = nil + ) { + self.url = url + self.htmlUrl = htmlUrl + self.assetsUrl = assetsUrl + self.uploadUrl = uploadUrl + self.tarballUrl = tarballUrl + self.zipballUrl = zipballUrl + self.id = id + self.nodeId = nodeId + self.tagName = tagName + self.targetCommitish = targetCommitish + self.name = name + self.body = body + self.draft = draft + self.prerelease = prerelease + self.immutable = immutable + self.createdAt = createdAt + self.publishedAt = publishedAt + self.updatedAt = updatedAt + self.author = author + self.assets = assets + self.bodyHtml = bodyHtml + self.bodyText = bodyText + self.mentionsCount = mentionsCount + self.discussionUrl = discussionUrl + self.reactions = reactions } - /// Enable or disable Dependabot security updates for the repository. - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. - public var dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public struct SecretScanningPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. - public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? - /// Creates a new `SecretScanningPayload`. + public enum CodingKeys: String, CodingKey { + case url + case htmlUrl = "html_url" + case assetsUrl = "assets_url" + case uploadUrl = "upload_url" + case tarballUrl = "tarball_url" + case zipballUrl = "zipball_url" + case id + case nodeId = "node_id" + case tagName = "tag_name" + case targetCommitish = "target_commitish" + case name + case body + case draft + case prerelease + case immutable + case createdAt = "created_at" + case publishedAt = "published_at" + case updatedAt = "updated_at" + case author + case assets + case bodyHtml = "body_html" + case bodyText = "body_text" + case mentionsCount = "mentions_count" + case discussionUrl = "discussion_url" + case reactions + } + } + /// Event + /// + /// - Remark: Generated from `#/components/schemas/event`. + public struct Event: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/event/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/event/type`. + public var _type: Swift.String? + /// - Remark: Generated from `#/components/schemas/event/actor`. + public var actor: Components.Schemas.Actor + /// - Remark: Generated from `#/components/schemas/event/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/event/repo/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/event/repo/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/event/repo/url`. + public var url: Swift.String + /// Creates a new `RepoPayload`. /// /// - Parameters: - /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? = nil) { - self.status = status + /// - id: + /// - name: + /// - url: + public init( + id: Swift.Int, + name: Swift.String, + url: Swift.String + ) { + self.id = id + self.name = name + self.url = url } public enum CodingKeys: String, CodingKey { - case status + case id + case name + case url } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. - public var secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public struct SecretScanningPushProtectionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. - public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? - /// Creates a new `SecretScanningPushProtectionPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? = nil) { - self.status = status + /// - Remark: Generated from `#/components/schemas/event/repo`. + public var repo: Components.Schemas.Event.RepoPayload + /// - Remark: Generated from `#/components/schemas/event/org`. + public var org: Components.Schemas.Actor? + /// - Remark: Generated from `#/components/schemas/event/payload`. + @frozen public enum PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/event/payload/case1`. + case CreateEvent(Components.Schemas.CreateEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case2`. + case DeleteEvent(Components.Schemas.DeleteEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case3`. + case DiscussionEvent(Components.Schemas.DiscussionEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case4`. + case IssuesEvent(Components.Schemas.IssuesEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case5`. + case IssueCommentEvent(Components.Schemas.IssueCommentEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case6`. + case ForkEvent(Components.Schemas.ForkEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case7`. + case GollumEvent(Components.Schemas.GollumEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case8`. + case MemberEvent(Components.Schemas.MemberEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case9`. + case PublicEvent(Components.Schemas.PublicEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case10`. + case PushEvent(Components.Schemas.PushEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case11`. + case PullRequestEvent(Components.Schemas.PullRequestEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case12`. + case PullRequestReviewCommentEvent(Components.Schemas.PullRequestReviewCommentEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case13`. + case PullRequestReviewEvent(Components.Schemas.PullRequestReviewEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case14`. + case CommitCommentEvent(Components.Schemas.CommitCommentEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case15`. + case ReleaseEvent(Components.Schemas.ReleaseEvent) + /// - Remark: Generated from `#/components/schemas/event/payload/case16`. + case WatchEvent(Components.Schemas.WatchEvent) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .CreateEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .DeleteEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .DiscussionEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .IssuesEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .IssueCommentEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ForkEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .GollumEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .MemberEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PublicEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PushEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestReviewCommentEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestReviewEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .CommitCommentEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ReleaseEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .WatchEvent(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case status + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .CreateEvent(value): + try value.encode(to: encoder) + case let .DeleteEvent(value): + try value.encode(to: encoder) + case let .DiscussionEvent(value): + try value.encode(to: encoder) + case let .IssuesEvent(value): + try value.encode(to: encoder) + case let .IssueCommentEvent(value): + try value.encode(to: encoder) + case let .ForkEvent(value): + try value.encode(to: encoder) + case let .GollumEvent(value): + try value.encode(to: encoder) + case let .MemberEvent(value): + try value.encode(to: encoder) + case let .PublicEvent(value): + try value.encode(to: encoder) + case let .PushEvent(value): + try value.encode(to: encoder) + case let .PullRequestEvent(value): + try value.encode(to: encoder) + case let .PullRequestReviewCommentEvent(value): + try value.encode(to: encoder) + case let .PullRequestReviewEvent(value): + try value.encode(to: encoder) + case let .CommitCommentEvent(value): + try value.encode(to: encoder) + case let .ReleaseEvent(value): + try value.encode(to: encoder) + case let .WatchEvent(value): + try value.encode(to: encoder) + } } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. - public var secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. - public struct SecretScanningNonProviderPatternsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. - public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? - /// Creates a new `SecretScanningNonProviderPatternsPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? = nil) { - self.status = status + /// - Remark: Generated from `#/components/schemas/event/payload`. + public var payload: Components.Schemas.Event.PayloadPayload + /// - Remark: Generated from `#/components/schemas/event/public`. + public var _public: Swift.Bool + /// - Remark: Generated from `#/components/schemas/event/created_at`. + public var createdAt: Foundation.Date? + /// Creates a new `Event`. + /// + /// - Parameters: + /// - id: + /// - _type: + /// - actor: + /// - repo: + /// - org: + /// - payload: + /// - _public: + /// - createdAt: + public init( + id: Swift.String, + _type: Swift.String? = nil, + actor: Components.Schemas.Actor, + repo: Components.Schemas.Event.RepoPayload, + org: Components.Schemas.Actor? = nil, + payload: Components.Schemas.Event.PayloadPayload, + _public: Swift.Bool, + createdAt: Foundation.Date? = nil + ) { + self.id = id + self._type = _type + self.actor = actor + self.repo = repo + self.org = org + self.payload = payload + self._public = _public + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case actor + case repo + case org + case payload + case _public = "public" + case createdAt = "created_at" + } + } + /// Hypermedia Link with Type + /// + /// - Remark: Generated from `#/components/schemas/link-with-type`. + public struct LinkWithType: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link-with-type/href`. + public var href: Swift.String + /// - Remark: Generated from `#/components/schemas/link-with-type/type`. + public var _type: Swift.String + /// Creates a new `LinkWithType`. + /// + /// - Parameters: + /// - href: + /// - _type: + public init( + href: Swift.String, + _type: Swift.String + ) { + self.href = href + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case href + case _type = "type" + } + } + /// Feed + /// + /// - Remark: Generated from `#/components/schemas/feed`. + public struct Feed: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/feed/timeline_url`. + public var timelineUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/feed/user_url`. + public var userUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/feed/current_user_public_url`. + public var currentUserPublicUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/feed/current_user_url`. + public var currentUserUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/feed/current_user_actor_url`. + public var currentUserActorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/feed/current_user_organization_url`. + public var currentUserOrganizationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/feed/current_user_organization_urls`. + public var currentUserOrganizationUrls: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/feed/security_advisories_url`. + public var securityAdvisoriesUrl: Swift.String? + /// A feed of discussions for a given repository. + /// + /// - Remark: Generated from `#/components/schemas/feed/repository_discussions_url`. + public var repositoryDiscussionsUrl: Swift.String? + /// A feed of discussions for a given repository and category. + /// + /// - Remark: Generated from `#/components/schemas/feed/repository_discussions_category_url`. + public var repositoryDiscussionsCategoryUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/feed/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/feed/_links/timeline`. + public var timeline: Components.Schemas.LinkWithType + /// - Remark: Generated from `#/components/schemas/feed/_links/user`. + public var user: Components.Schemas.LinkWithType + /// - Remark: Generated from `#/components/schemas/feed/_links/security_advisories`. + public var securityAdvisories: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/current_user`. + public var currentUser: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_public`. + public var currentUserPublic: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_actor`. + public var currentUserActor: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_organization`. + public var currentUserOrganization: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/current_user_organizations`. + public var currentUserOrganizations: [Components.Schemas.LinkWithType]? + /// - Remark: Generated from `#/components/schemas/feed/_links/repository_discussions`. + public var repositoryDiscussions: Components.Schemas.LinkWithType? + /// - Remark: Generated from `#/components/schemas/feed/_links/repository_discussions_category`. + public var repositoryDiscussionsCategory: Components.Schemas.LinkWithType? + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - timeline: + /// - user: + /// - securityAdvisories: + /// - currentUser: + /// - currentUserPublic: + /// - currentUserActor: + /// - currentUserOrganization: + /// - currentUserOrganizations: + /// - repositoryDiscussions: + /// - repositoryDiscussionsCategory: + public init( + timeline: Components.Schemas.LinkWithType, + user: Components.Schemas.LinkWithType, + securityAdvisories: Components.Schemas.LinkWithType? = nil, + currentUser: Components.Schemas.LinkWithType? = nil, + currentUserPublic: Components.Schemas.LinkWithType? = nil, + currentUserActor: Components.Schemas.LinkWithType? = nil, + currentUserOrganization: Components.Schemas.LinkWithType? = nil, + currentUserOrganizations: [Components.Schemas.LinkWithType]? = nil, + repositoryDiscussions: Components.Schemas.LinkWithType? = nil, + repositoryDiscussionsCategory: Components.Schemas.LinkWithType? = nil + ) { + self.timeline = timeline + self.user = user + self.securityAdvisories = securityAdvisories + self.currentUser = currentUser + self.currentUserPublic = currentUserPublic + self.currentUserActor = currentUserActor + self.currentUserOrganization = currentUserOrganization + self.currentUserOrganizations = currentUserOrganizations + self.repositoryDiscussions = repositoryDiscussions + self.repositoryDiscussionsCategory = repositoryDiscussionsCategory } public enum CodingKeys: String, CodingKey { - case status + case timeline + case user + case securityAdvisories = "security_advisories" + case currentUser = "current_user" + case currentUserPublic = "current_user_public" + case currentUserActor = "current_user_actor" + case currentUserOrganization = "current_user_organization" + case currentUserOrganizations = "current_user_organizations" + case repositoryDiscussions = "repository_discussions" + case repositoryDiscussionsCategory = "repository_discussions_category" } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. - public var secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. - public struct SecretScanningAiDetectionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + /// - Remark: Generated from `#/components/schemas/feed/_links`. + public var _links: Components.Schemas.Feed._LinksPayload + /// Creates a new `Feed`. + /// + /// - Parameters: + /// - timelineUrl: + /// - userUrl: + /// - currentUserPublicUrl: + /// - currentUserUrl: + /// - currentUserActorUrl: + /// - currentUserOrganizationUrl: + /// - currentUserOrganizationUrls: + /// - securityAdvisoriesUrl: + /// - repositoryDiscussionsUrl: A feed of discussions for a given repository. + /// - repositoryDiscussionsCategoryUrl: A feed of discussions for a given repository and category. + /// - _links: + public init( + timelineUrl: Swift.String, + userUrl: Swift.String, + currentUserPublicUrl: Swift.String? = nil, + currentUserUrl: Swift.String? = nil, + currentUserActorUrl: Swift.String? = nil, + currentUserOrganizationUrl: Swift.String? = nil, + currentUserOrganizationUrls: [Swift.String]? = nil, + securityAdvisoriesUrl: Swift.String? = nil, + repositoryDiscussionsUrl: Swift.String? = nil, + repositoryDiscussionsCategoryUrl: Swift.String? = nil, + _links: Components.Schemas.Feed._LinksPayload + ) { + self.timelineUrl = timelineUrl + self.userUrl = userUrl + self.currentUserPublicUrl = currentUserPublicUrl + self.currentUserUrl = currentUserUrl + self.currentUserActorUrl = currentUserActorUrl + self.currentUserOrganizationUrl = currentUserOrganizationUrl + self.currentUserOrganizationUrls = currentUserOrganizationUrls + self.securityAdvisoriesUrl = securityAdvisoriesUrl + self.repositoryDiscussionsUrl = repositoryDiscussionsUrl + self.repositoryDiscussionsCategoryUrl = repositoryDiscussionsCategoryUrl + self._links = _links + } + public enum CodingKeys: String, CodingKey { + case timelineUrl = "timeline_url" + case userUrl = "user_url" + case currentUserPublicUrl = "current_user_public_url" + case currentUserUrl = "current_user_url" + case currentUserActorUrl = "current_user_actor_url" + case currentUserOrganizationUrl = "current_user_organization_url" + case currentUserOrganizationUrls = "current_user_organization_urls" + case securityAdvisoriesUrl = "security_advisories_url" + case repositoryDiscussionsUrl = "repository_discussions_url" + case repositoryDiscussionsCategoryUrl = "repository_discussions_category_url" + case _links + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" case disabled = "disabled" } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. - public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? - /// Creates a new `SecretScanningAiDetectionPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? + /// Creates a new `AdvancedSecurityPayload`. /// /// - Parameters: /// - status: - public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? = nil) { + public init(status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? = nil) { self.status = status } public enum CodingKeys: String, CodingKey { case status } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. - public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? - /// Creates a new `SecurityAndAnalysis`. + /// Enable or disable GitHub Advanced Security for the repository. /// - /// - Parameters: - /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. - /// - codeSecurity: - /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct CodeSecurityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? + /// Creates a new `CodeSecurityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public struct DependabotSecurityUpdatesPayload: Codable, Hashable, Sendable { + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + public var status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? + /// Creates a new `DependabotSecurityUpdatesPayload`. + /// + /// - Parameters: + /// - status: The enablement status of Dependabot security updates for the repository. + public init(status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public var dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public struct SecretScanningPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? + /// Creates a new `SecretScanningPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public var secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public struct SecretScanningPushProtectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? + /// Creates a new `SecretScanningPushProtectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public var secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public struct SecretScanningNonProviderPatternsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? + /// Creates a new `SecretScanningNonProviderPatternsPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public var secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct SecretScanningAiDetectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? + /// Creates a new `SecretScanningAiDetectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? + /// Creates a new `SecurityAndAnalysis`. + /// + /// - Parameters: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. + /// - codeSecurity: + /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -4117,7 +5629,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -4126,6 +5641,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -4135,6 +5653,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -4277,6 +5798,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -4412,10 +5948,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -4493,6 +6029,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -4582,6 +6121,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -4671,6 +6213,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4694,354 +6239,2075 @@ public enum Components { self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case name - case fullName = "full_name" - case owner - case _private = "private" - case htmlUrl = "html_url" - case description - case fork - case url - case archiveUrl = "archive_url" - case assigneesUrl = "assignees_url" - case blobsUrl = "blobs_url" - case branchesUrl = "branches_url" - case collaboratorsUrl = "collaborators_url" - case commentsUrl = "comments_url" - case commitsUrl = "commits_url" - case compareUrl = "compare_url" - case contentsUrl = "contents_url" - case contributorsUrl = "contributors_url" - case deploymentsUrl = "deployments_url" - case downloadsUrl = "downloads_url" - case eventsUrl = "events_url" - case forksUrl = "forks_url" - case gitCommitsUrl = "git_commits_url" - case gitRefsUrl = "git_refs_url" - case gitTagsUrl = "git_tags_url" - case gitUrl = "git_url" - case issueCommentUrl = "issue_comment_url" - case issueEventsUrl = "issue_events_url" - case issuesUrl = "issues_url" - case keysUrl = "keys_url" - case labelsUrl = "labels_url" - case languagesUrl = "languages_url" - case mergesUrl = "merges_url" - case milestonesUrl = "milestones_url" - case notificationsUrl = "notifications_url" - case pullsUrl = "pulls_url" - case releasesUrl = "releases_url" - case sshUrl = "ssh_url" - case stargazersUrl = "stargazers_url" - case statusesUrl = "statuses_url" - case subscribersUrl = "subscribers_url" - case subscriptionUrl = "subscription_url" - case tagsUrl = "tags_url" - case teamsUrl = "teams_url" - case treesUrl = "trees_url" - case cloneUrl = "clone_url" - case mirrorUrl = "mirror_url" - case hooksUrl = "hooks_url" - case svnUrl = "svn_url" - case homepage - case language - case forksCount = "forks_count" - case stargazersCount = "stargazers_count" - case watchersCount = "watchers_count" - case size - case defaultBranch = "default_branch" - case openIssuesCount = "open_issues_count" - case isTemplate = "is_template" - case topics - case hasIssues = "has_issues" - case hasProjects = "has_projects" - case hasWiki = "has_wiki" - case hasPages = "has_pages" - case hasDownloads = "has_downloads" - case hasDiscussions = "has_discussions" - case archived - case disabled - case visibility - case pushedAt = "pushed_at" - case createdAt = "created_at" - case updatedAt = "updated_at" - case permissions - case roleName = "role_name" - case tempCloneToken = "temp_clone_token" - case deleteBranchOnMerge = "delete_branch_on_merge" - case subscribersCount = "subscribers_count" - case networkCount = "network_count" - case codeOfConduct = "code_of_conduct" - case license - case forks - case openIssues = "open_issues" - case watchers - case allowForking = "allow_forking" - case webCommitSignoffRequired = "web_commit_signoff_required" - case securityAndAnalysis = "security_and_analysis" - case customProperties = "custom_properties" + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case roleName = "role_name" + case tempCloneToken = "temp_clone_token" + case deleteBranchOnMerge = "delete_branch_on_merge" + case subscribersCount = "subscribers_count" + case networkCount = "network_count" + case codeOfConduct = "code_of_conduct" + case license + case forks + case openIssues = "open_issues" + case watchers + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" + } + } + /// Thread + /// + /// - Remark: Generated from `#/components/schemas/thread`. + public struct Thread: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/thread/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/repository`. + public var repository: Components.Schemas.MinimalRepository + /// - Remark: Generated from `#/components/schemas/thread/subject`. + public struct SubjectPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/thread/subject/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/subject/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/subject/latest_comment_url`. + public var latestCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/subject/type`. + public var _type: Swift.String + /// Creates a new `SubjectPayload`. + /// + /// - Parameters: + /// - title: + /// - url: + /// - latestCommentUrl: + /// - _type: + public init( + title: Swift.String, + url: Swift.String, + latestCommentUrl: Swift.String, + _type: Swift.String + ) { + self.title = title + self.url = url + self.latestCommentUrl = latestCommentUrl + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case title + case url + case latestCommentUrl = "latest_comment_url" + case _type = "type" + } + } + /// - Remark: Generated from `#/components/schemas/thread/subject`. + public var subject: Components.Schemas.Thread.SubjectPayload + /// - Remark: Generated from `#/components/schemas/thread/reason`. + public var reason: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/unread`. + public var unread: Swift.Bool + /// - Remark: Generated from `#/components/schemas/thread/updated_at`. + public var updatedAt: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/last_read_at`. + public var lastReadAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/thread/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/thread/subscription_url`. + public var subscriptionUrl: Swift.String + /// Creates a new `Thread`. + /// + /// - Parameters: + /// - id: + /// - repository: + /// - subject: + /// - reason: + /// - unread: + /// - updatedAt: + /// - lastReadAt: + /// - url: + /// - subscriptionUrl: + public init( + id: Swift.String, + repository: Components.Schemas.MinimalRepository, + subject: Components.Schemas.Thread.SubjectPayload, + reason: Swift.String, + unread: Swift.Bool, + updatedAt: Swift.String, + lastReadAt: Swift.String? = nil, + url: Swift.String, + subscriptionUrl: Swift.String + ) { + self.id = id + self.repository = repository + self.subject = subject + self.reason = reason + self.unread = unread + self.updatedAt = updatedAt + self.lastReadAt = lastReadAt + self.url = url + self.subscriptionUrl = subscriptionUrl + } + public enum CodingKeys: String, CodingKey { + case id + case repository + case subject + case reason + case unread + case updatedAt = "updated_at" + case lastReadAt = "last_read_at" + case url + case subscriptionUrl = "subscription_url" + } + } + /// Thread Subscription + /// + /// - Remark: Generated from `#/components/schemas/thread-subscription`. + public struct ThreadSubscription: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/thread-subscription/subscribed`. + public var subscribed: Swift.Bool + /// - Remark: Generated from `#/components/schemas/thread-subscription/ignored`. + public var ignored: Swift.Bool + /// - Remark: Generated from `#/components/schemas/thread-subscription/reason`. + public var reason: Swift.String? + /// - Remark: Generated from `#/components/schemas/thread-subscription/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/thread-subscription/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/thread-subscription/thread_url`. + public var threadUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/thread-subscription/repository_url`. + public var repositoryUrl: Swift.String? + /// Creates a new `ThreadSubscription`. + /// + /// - Parameters: + /// - subscribed: + /// - ignored: + /// - reason: + /// - createdAt: + /// - url: + /// - threadUrl: + /// - repositoryUrl: + public init( + subscribed: Swift.Bool, + ignored: Swift.Bool, + reason: Swift.String? = nil, + createdAt: Foundation.Date? = nil, + url: Swift.String, + threadUrl: Swift.String? = nil, + repositoryUrl: Swift.String? = nil + ) { + self.subscribed = subscribed + self.ignored = ignored + self.reason = reason + self.createdAt = createdAt + self.url = url + self.threadUrl = threadUrl + self.repositoryUrl = repositoryUrl + } + public enum CodingKeys: String, CodingKey { + case subscribed + case ignored + case reason + case createdAt = "created_at" + case url + case threadUrl = "thread_url" + case repositoryUrl = "repository_url" + } + } + /// Stargazer + /// + /// - Remark: Generated from `#/components/schemas/stargazer`. + public struct Stargazer: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/stargazer/starred_at`. + public var starredAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/stargazer/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `Stargazer`. + /// + /// - Parameters: + /// - starredAt: + /// - user: + public init( + starredAt: Foundation.Date, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.starredAt = starredAt + self.user = user + } + public enum CodingKeys: String, CodingKey { + case starredAt = "starred_at" + case user + } + } + /// Repository invitations let you manage who you collaborate with. + /// + /// - Remark: Generated from `#/components/schemas/repository-subscription`. + public struct RepositorySubscription: Codable, Hashable, Sendable { + /// Determines if notifications should be received from this repository. + /// + /// - Remark: Generated from `#/components/schemas/repository-subscription/subscribed`. + public var subscribed: Swift.Bool + /// Determines if all notifications should be blocked from this repository. + /// + /// - Remark: Generated from `#/components/schemas/repository-subscription/ignored`. + public var ignored: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository-subscription/reason`. + public var reason: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository-subscription/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/repository-subscription/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-subscription/repository_url`. + public var repositoryUrl: Swift.String + /// Creates a new `RepositorySubscription`. + /// + /// - Parameters: + /// - subscribed: Determines if notifications should be received from this repository. + /// - ignored: Determines if all notifications should be blocked from this repository. + /// - reason: + /// - createdAt: + /// - url: + /// - repositoryUrl: + public init( + subscribed: Swift.Bool, + ignored: Swift.Bool, + reason: Swift.String? = nil, + createdAt: Foundation.Date, + url: Swift.String, + repositoryUrl: Swift.String + ) { + self.subscribed = subscribed + self.ignored = ignored + self.reason = reason + self.createdAt = createdAt + self.url = url + self.repositoryUrl = repositoryUrl + } + public enum CodingKeys: String, CodingKey { + case subscribed + case ignored + case reason + case createdAt = "created_at" + case url + case repositoryUrl = "repository_url" + } + } + /// Starred Repository + /// + /// - Remark: Generated from `#/components/schemas/starred-repository`. + public struct StarredRepository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/starred-repository/starred_at`. + public var starredAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/starred-repository/repo`. + public var repo: Components.Schemas.Repository + /// Creates a new `StarredRepository`. + /// + /// - Parameters: + /// - starredAt: + /// - repo: + public init( + starredAt: Foundation.Date, + repo: Components.Schemas.Repository + ) { + self.starredAt = starredAt + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case starredAt = "starred_at" + case repo + } + } + /// - Remark: Generated from `#/components/schemas/create-event`. + public struct CreateEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/create-event/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/create-event/ref_type`. + public var refType: Swift.String + /// - Remark: Generated from `#/components/schemas/create-event/full_ref`. + public var fullRef: Swift.String + /// - Remark: Generated from `#/components/schemas/create-event/master_branch`. + public var masterBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/create-event/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/create-event/pusher_type`. + public var pusherType: Swift.String + /// Creates a new `CreateEvent`. + /// + /// - Parameters: + /// - ref: + /// - refType: + /// - fullRef: + /// - masterBranch: + /// - description: + /// - pusherType: + public init( + ref: Swift.String, + refType: Swift.String, + fullRef: Swift.String, + masterBranch: Swift.String, + description: Swift.String? = nil, + pusherType: Swift.String + ) { + self.ref = ref + self.refType = refType + self.fullRef = fullRef + self.masterBranch = masterBranch + self.description = description + self.pusherType = pusherType + } + public enum CodingKeys: String, CodingKey { + case ref + case refType = "ref_type" + case fullRef = "full_ref" + case masterBranch = "master_branch" + case description + case pusherType = "pusher_type" + } + } + /// - Remark: Generated from `#/components/schemas/delete-event`. + public struct DeleteEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/delete-event/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/delete-event/ref_type`. + public var refType: Swift.String + /// - Remark: Generated from `#/components/schemas/delete-event/full_ref`. + public var fullRef: Swift.String + /// - Remark: Generated from `#/components/schemas/delete-event/pusher_type`. + public var pusherType: Swift.String + /// Creates a new `DeleteEvent`. + /// + /// - Parameters: + /// - ref: + /// - refType: + /// - fullRef: + /// - pusherType: + public init( + ref: Swift.String, + refType: Swift.String, + fullRef: Swift.String, + pusherType: Swift.String + ) { + self.ref = ref + self.refType = refType + self.fullRef = fullRef + self.pusherType = pusherType + } + public enum CodingKeys: String, CodingKey { + case ref + case refType = "ref_type" + case fullRef = "full_ref" + case pusherType = "pusher_type" + } + } + /// - Remark: Generated from `#/components/schemas/discussion-event`. + public struct DiscussionEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/discussion-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/discussion-event/discussion`. + public var discussion: Components.Schemas.Discussion + /// Creates a new `DiscussionEvent`. + /// + /// - Parameters: + /// - action: + /// - discussion: + public init( + action: Swift.String, + discussion: Components.Schemas.Discussion + ) { + self.action = action + self.discussion = discussion + } + public enum CodingKeys: String, CodingKey { + case action + case discussion + } + } + /// - Remark: Generated from `#/components/schemas/issues-event`. + public struct IssuesEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issues-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/issues-event/issue`. + public var issue: Components.Schemas.Issue + /// - Remark: Generated from `#/components/schemas/issues-event/assignee`. + public var assignee: Components.Schemas.SimpleUser? + /// - Remark: Generated from `#/components/schemas/issues-event/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/issues-event/label`. + public var label: Components.Schemas.Label? + /// - Remark: Generated from `#/components/schemas/issues-event/labels`. + public var labels: [Components.Schemas.Label]? + /// Creates a new `IssuesEvent`. + /// + /// - Parameters: + /// - action: + /// - issue: + /// - assignee: + /// - assignees: + /// - label: + /// - labels: + public init( + action: Swift.String, + issue: Components.Schemas.Issue, + assignee: Components.Schemas.SimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + label: Components.Schemas.Label? = nil, + labels: [Components.Schemas.Label]? = nil + ) { + self.action = action + self.issue = issue + self.assignee = assignee + self.assignees = assignees + self.label = label + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case action + case issue + case assignee + case assignees + case label + case labels + } + } + /// - Remark: Generated from `#/components/schemas/issue-comment-event`. + public struct IssueCommentEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-comment-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/issue-comment-event/issue`. + public var issue: Components.Schemas.Issue + /// - Remark: Generated from `#/components/schemas/issue-comment-event/comment`. + public var comment: Components.Schemas.IssueComment + /// Creates a new `IssueCommentEvent`. + /// + /// - Parameters: + /// - action: + /// - issue: + /// - comment: + public init( + action: Swift.String, + issue: Components.Schemas.Issue, + comment: Components.Schemas.IssueComment + ) { + self.action = action + self.issue = issue + self.comment = comment + } + public enum CodingKeys: String, CodingKey { + case action + case issue + case comment + } + } + /// - Remark: Generated from `#/components/schemas/fork-event`. + public struct ForkEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/fork-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/fork-event/forkee`. + public struct ForkeePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/full_name`. + public var fullName: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/private`. + public var _private: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/owner`. + public var owner: Components.Schemas.SimpleUser? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/fork`. + public var fork: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/forks_url`. + public var forksUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/keys_url`. + public var keysUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/collaborators_url`. + public var collaboratorsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/teams_url`. + public var teamsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/hooks_url`. + public var hooksUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/issue_events_url`. + public var issueEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/assignees_url`. + public var assigneesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/branches_url`. + public var branchesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/tags_url`. + public var tagsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/blobs_url`. + public var blobsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/git_tags_url`. + public var gitTagsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/git_refs_url`. + public var gitRefsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/trees_url`. + public var treesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/statuses_url`. + public var statusesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/languages_url`. + public var languagesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/stargazers_url`. + public var stargazersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/contributors_url`. + public var contributorsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/subscribers_url`. + public var subscribersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/subscription_url`. + public var subscriptionUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/commits_url`. + public var commitsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/git_commits_url`. + public var gitCommitsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/comments_url`. + public var commentsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/issue_comment_url`. + public var issueCommentUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/contents_url`. + public var contentsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/compare_url`. + public var compareUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/merges_url`. + public var mergesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/archive_url`. + public var archiveUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/downloads_url`. + public var downloadsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/issues_url`. + public var issuesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/pulls_url`. + public var pullsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/milestones_url`. + public var milestonesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/notifications_url`. + public var notificationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/labels_url`. + public var labelsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/releases_url`. + public var releasesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/deployments_url`. + public var deploymentsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/git_url`. + public var gitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/ssh_url`. + public var sshUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/clone_url`. + public var cloneUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/svn_url`. + public var svnUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/size`. + public var size: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/stargazers_count`. + public var stargazersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/watchers_count`. + public var watchersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_issues`. + public var hasIssues: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_projects`. + public var hasProjects: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_downloads`. + public var hasDownloads: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_wiki`. + public var hasWiki: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_pages`. + public var hasPages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.ForkEvent.ForkeePayload.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_commit_comments`. + public var hasCommitComments: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/forks_count`. + public var forksCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/archived`. + public var archived: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/disabled`. + public var disabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/open_issues_count`. + public var openIssuesCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/allow_forking`. + public var allowForking: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/topics`. + public var topics: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/forks`. + public var forks: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/open_issues`. + public var openIssues: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/watchers`. + public var watchers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/default_branch`. + public var defaultBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/fork-event/forkee/public`. + public var _public: Swift.Bool? + /// Creates a new `ForkeePayload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - name: + /// - fullName: + /// - _private: + /// - owner: + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - forksUrl: + /// - keysUrl: + /// - collaboratorsUrl: + /// - teamsUrl: + /// - hooksUrl: + /// - issueEventsUrl: + /// - eventsUrl: + /// - assigneesUrl: + /// - branchesUrl: + /// - tagsUrl: + /// - blobsUrl: + /// - gitTagsUrl: + /// - gitRefsUrl: + /// - treesUrl: + /// - statusesUrl: + /// - languagesUrl: + /// - stargazersUrl: + /// - contributorsUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - commitsUrl: + /// - gitCommitsUrl: + /// - commentsUrl: + /// - issueCommentUrl: + /// - contentsUrl: + /// - compareUrl: + /// - mergesUrl: + /// - archiveUrl: + /// - downloadsUrl: + /// - issuesUrl: + /// - pullsUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - labelsUrl: + /// - releasesUrl: + /// - deploymentsUrl: + /// - createdAt: + /// - updatedAt: + /// - pushedAt: + /// - gitUrl: + /// - sshUrl: + /// - cloneUrl: + /// - svnUrl: + /// - homepage: + /// - size: + /// - stargazersCount: + /// - watchersCount: + /// - language: + /// - hasIssues: + /// - hasProjects: + /// - hasDownloads: + /// - hasWiki: + /// - hasPages: + /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: + /// - forksCount: + /// - mirrorUrl: + /// - archived: + /// - disabled: + /// - openIssuesCount: + /// - license: + /// - allowForking: + /// - isTemplate: + /// - webCommitSignoffRequired: + /// - topics: + /// - visibility: + /// - forks: + /// - openIssues: + /// - watchers: + /// - defaultBranch: + /// - _public: + public init( + id: Swift.Int? = nil, + nodeId: Swift.String? = nil, + name: Swift.String? = nil, + fullName: Swift.String? = nil, + _private: Swift.Bool? = nil, + owner: Components.Schemas.SimpleUser? = nil, + htmlUrl: Swift.String? = nil, + description: Swift.String? = nil, + fork: Swift.Bool? = nil, + url: Swift.String? = nil, + forksUrl: Swift.String? = nil, + keysUrl: Swift.String? = nil, + collaboratorsUrl: Swift.String? = nil, + teamsUrl: Swift.String? = nil, + hooksUrl: Swift.String? = nil, + issueEventsUrl: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + assigneesUrl: Swift.String? = nil, + branchesUrl: Swift.String? = nil, + tagsUrl: Swift.String? = nil, + blobsUrl: Swift.String? = nil, + gitTagsUrl: Swift.String? = nil, + gitRefsUrl: Swift.String? = nil, + treesUrl: Swift.String? = nil, + statusesUrl: Swift.String? = nil, + languagesUrl: Swift.String? = nil, + stargazersUrl: Swift.String? = nil, + contributorsUrl: Swift.String? = nil, + subscribersUrl: Swift.String? = nil, + subscriptionUrl: Swift.String? = nil, + commitsUrl: Swift.String? = nil, + gitCommitsUrl: Swift.String? = nil, + commentsUrl: Swift.String? = nil, + issueCommentUrl: Swift.String? = nil, + contentsUrl: Swift.String? = nil, + compareUrl: Swift.String? = nil, + mergesUrl: Swift.String? = nil, + archiveUrl: Swift.String? = nil, + downloadsUrl: Swift.String? = nil, + issuesUrl: Swift.String? = nil, + pullsUrl: Swift.String? = nil, + milestonesUrl: Swift.String? = nil, + notificationsUrl: Swift.String? = nil, + labelsUrl: Swift.String? = nil, + releasesUrl: Swift.String? = nil, + deploymentsUrl: Swift.String? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + pushedAt: Foundation.Date? = nil, + gitUrl: Swift.String? = nil, + sshUrl: Swift.String? = nil, + cloneUrl: Swift.String? = nil, + svnUrl: Swift.String? = nil, + homepage: Swift.String? = nil, + size: Swift.Int? = nil, + stargazersCount: Swift.Int? = nil, + watchersCount: Swift.Int? = nil, + language: Swift.String? = nil, + hasIssues: Swift.Bool? = nil, + hasProjects: Swift.Bool? = nil, + hasDownloads: Swift.Bool? = nil, + hasWiki: Swift.Bool? = nil, + hasPages: Swift.Bool? = nil, + hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.ForkEvent.ForkeePayload.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, + forksCount: Swift.Int? = nil, + mirrorUrl: Swift.String? = nil, + archived: Swift.Bool? = nil, + disabled: Swift.Bool? = nil, + openIssuesCount: Swift.Int? = nil, + license: Components.Schemas.NullableLicenseSimple? = nil, + allowForking: Swift.Bool? = nil, + isTemplate: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + visibility: Swift.String? = nil, + forks: Swift.Int? = nil, + openIssues: Swift.Int? = nil, + watchers: Swift.Int? = nil, + defaultBranch: Swift.String? = nil, + _public: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self._private = _private + self.owner = owner + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.forksUrl = forksUrl + self.keysUrl = keysUrl + self.collaboratorsUrl = collaboratorsUrl + self.teamsUrl = teamsUrl + self.hooksUrl = hooksUrl + self.issueEventsUrl = issueEventsUrl + self.eventsUrl = eventsUrl + self.assigneesUrl = assigneesUrl + self.branchesUrl = branchesUrl + self.tagsUrl = tagsUrl + self.blobsUrl = blobsUrl + self.gitTagsUrl = gitTagsUrl + self.gitRefsUrl = gitRefsUrl + self.treesUrl = treesUrl + self.statusesUrl = statusesUrl + self.languagesUrl = languagesUrl + self.stargazersUrl = stargazersUrl + self.contributorsUrl = contributorsUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.commitsUrl = commitsUrl + self.gitCommitsUrl = gitCommitsUrl + self.commentsUrl = commentsUrl + self.issueCommentUrl = issueCommentUrl + self.contentsUrl = contentsUrl + self.compareUrl = compareUrl + self.mergesUrl = mergesUrl + self.archiveUrl = archiveUrl + self.downloadsUrl = downloadsUrl + self.issuesUrl = issuesUrl + self.pullsUrl = pullsUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.labelsUrl = labelsUrl + self.releasesUrl = releasesUrl + self.deploymentsUrl = deploymentsUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + self.pushedAt = pushedAt + self.gitUrl = gitUrl + self.sshUrl = sshUrl + self.cloneUrl = cloneUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.size = size + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.language = language + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasDownloads = hasDownloads + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments + self.forksCount = forksCount + self.mirrorUrl = mirrorUrl + self.archived = archived + self.disabled = disabled + self.openIssuesCount = openIssuesCount + self.license = license + self.allowForking = allowForking + self.isTemplate = isTemplate + self.webCommitSignoffRequired = webCommitSignoffRequired + self.topics = topics + self.visibility = visibility + self.forks = forks + self.openIssues = openIssues + self.watchers = watchers + self.defaultBranch = defaultBranch + self._public = _public + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case _private = "private" + case owner + case htmlUrl = "html_url" + case description + case fork + case url + case forksUrl = "forks_url" + case keysUrl = "keys_url" + case collaboratorsUrl = "collaborators_url" + case teamsUrl = "teams_url" + case hooksUrl = "hooks_url" + case issueEventsUrl = "issue_events_url" + case eventsUrl = "events_url" + case assigneesUrl = "assignees_url" + case branchesUrl = "branches_url" + case tagsUrl = "tags_url" + case blobsUrl = "blobs_url" + case gitTagsUrl = "git_tags_url" + case gitRefsUrl = "git_refs_url" + case treesUrl = "trees_url" + case statusesUrl = "statuses_url" + case languagesUrl = "languages_url" + case stargazersUrl = "stargazers_url" + case contributorsUrl = "contributors_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case commitsUrl = "commits_url" + case gitCommitsUrl = "git_commits_url" + case commentsUrl = "comments_url" + case issueCommentUrl = "issue_comment_url" + case contentsUrl = "contents_url" + case compareUrl = "compare_url" + case mergesUrl = "merges_url" + case archiveUrl = "archive_url" + case downloadsUrl = "downloads_url" + case issuesUrl = "issues_url" + case pullsUrl = "pulls_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case labelsUrl = "labels_url" + case releasesUrl = "releases_url" + case deploymentsUrl = "deployments_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + case pushedAt = "pushed_at" + case gitUrl = "git_url" + case sshUrl = "ssh_url" + case cloneUrl = "clone_url" + case svnUrl = "svn_url" + case homepage + case size + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case language + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasDownloads = "has_downloads" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" + case forksCount = "forks_count" + case mirrorUrl = "mirror_url" + case archived + case disabled + case openIssuesCount = "open_issues_count" + case license + case allowForking = "allow_forking" + case isTemplate = "is_template" + case webCommitSignoffRequired = "web_commit_signoff_required" + case topics + case visibility + case forks + case openIssues = "open_issues" + case watchers + case defaultBranch = "default_branch" + case _public = "public" + } + } + /// - Remark: Generated from `#/components/schemas/fork-event/forkee`. + public var forkee: Components.Schemas.ForkEvent.ForkeePayload + /// Creates a new `ForkEvent`. + /// + /// - Parameters: + /// - action: + /// - forkee: + public init( + action: Swift.String, + forkee: Components.Schemas.ForkEvent.ForkeePayload + ) { + self.action = action + self.forkee = forkee + } + public enum CodingKeys: String, CodingKey { + case action + case forkee + } + } + /// - Remark: Generated from `#/components/schemas/gollum-event`. + public struct GollumEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload`. + public struct PagesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/page_name`. + public var pageName: Swift.String? + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/title`. + public var title: Swift.String? + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/summary`. + public var summary: Swift.String? + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/action`. + public var action: Swift.String? + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/sha`. + public var sha: Swift.String? + /// - Remark: Generated from `#/components/schemas/gollum-event/PagesPayload/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `PagesPayloadPayload`. + /// + /// - Parameters: + /// - pageName: + /// - title: + /// - summary: + /// - action: + /// - sha: + /// - htmlUrl: + public init( + pageName: Swift.String? = nil, + title: Swift.String? = nil, + summary: Swift.String? = nil, + action: Swift.String? = nil, + sha: Swift.String? = nil, + htmlUrl: Swift.String? = nil + ) { + self.pageName = pageName + self.title = title + self.summary = summary + self.action = action + self.sha = sha + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case pageName = "page_name" + case title + case summary + case action + case sha + case htmlUrl = "html_url" + } + } + /// - Remark: Generated from `#/components/schemas/gollum-event/pages`. + public typealias PagesPayload = [Components.Schemas.GollumEvent.PagesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/gollum-event/pages`. + public var pages: Components.Schemas.GollumEvent.PagesPayload + /// Creates a new `GollumEvent`. + /// + /// - Parameters: + /// - pages: + public init(pages: Components.Schemas.GollumEvent.PagesPayload) { + self.pages = pages + } + public enum CodingKeys: String, CodingKey { + case pages + } + } + /// - Remark: Generated from `#/components/schemas/member-event`. + public struct MemberEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/member-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/member-event/member`. + public var member: Components.Schemas.SimpleUser + /// Creates a new `MemberEvent`. + /// + /// - Parameters: + /// - action: + /// - member: + public init( + action: Swift.String, + member: Components.Schemas.SimpleUser + ) { + self.action = action + self.member = member + } + public enum CodingKeys: String, CodingKey { + case action + case member + } + } + /// - Remark: Generated from `#/components/schemas/public-event`. + public typealias PublicEvent = OpenAPIRuntime.OpenAPIObjectContainer + /// - Remark: Generated from `#/components/schemas/push-event`. + public struct PushEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/push-event/repository_id`. + public var repositoryId: Swift.Int + /// - Remark: Generated from `#/components/schemas/push-event/push_id`. + public var pushId: Swift.Int + /// - Remark: Generated from `#/components/schemas/push-event/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/push-event/head`. + public var head: Swift.String + /// - Remark: Generated from `#/components/schemas/push-event/before`. + public var before: Swift.String + /// Creates a new `PushEvent`. + /// + /// - Parameters: + /// - repositoryId: + /// - pushId: + /// - ref: + /// - head: + /// - before: + public init( + repositoryId: Swift.Int, + pushId: Swift.Int, + ref: Swift.String, + head: Swift.String, + before: Swift.String + ) { + self.repositoryId = repositoryId + self.pushId = pushId + self.ref = ref + self.head = head + self.before = before + } + public enum CodingKeys: String, CodingKey { + case repositoryId = "repository_id" + case pushId = "push_id" + case ref + case head + case before + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-event`. + public struct PullRequestEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-event/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-event/pull_request`. + public var pullRequest: Components.Schemas.PullRequestMinimal + /// - Remark: Generated from `#/components/schemas/pull-request-event/assignee`. + public var assignee: Components.Schemas.SimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-event/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-event/label`. + public var label: Components.Schemas.Label? + /// - Remark: Generated from `#/components/schemas/pull-request-event/labels`. + public var labels: [Components.Schemas.Label]? + /// Creates a new `PullRequestEvent`. + /// + /// - Parameters: + /// - action: + /// - number: + /// - pullRequest: + /// - assignee: + /// - assignees: + /// - label: + /// - labels: + public init( + action: Swift.String, + number: Swift.Int, + pullRequest: Components.Schemas.PullRequestMinimal, + assignee: Components.Schemas.SimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + label: Components.Schemas.Label? = nil, + labels: [Components.Schemas.Label]? = nil + ) { + self.action = action + self.number = number + self.pullRequest = pullRequest + self.assignee = assignee + self.assignees = assignees + self.label = label + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case action + case number + case pullRequest = "pull_request" + case assignee + case assignees + case label + case labels } } - /// Thread - /// - /// - Remark: Generated from `#/components/schemas/thread`. - public struct Thread: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/thread/id`. - public var id: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/repository`. - public var repository: Components.Schemas.MinimalRepository - /// - Remark: Generated from `#/components/schemas/thread/subject`. - public struct SubjectPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/thread/subject/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/subject/url`. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event`. + public struct PullRequestReviewCommentEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/pull_request`. + public var pullRequest: Components.Schemas.PullRequestMinimal + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment`. + public struct CommentPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/subject/latest_comment_url`. - public var latestCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/subject/type`. - public var _type: Swift.String - /// Creates a new `SubjectPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/pull_request_review_id`. + public var pullRequestReviewId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/diff_hunk`. + public var diffHunk: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/path`. + public var path: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/position`. + public var position: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/original_position`. + public var originalPosition: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/subject_type`. + public var subjectType: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/commit_id`. + public var commitId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/avatar_url`. + public var avatarUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/deleted`. + public var deleted: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/followers_url`. + public var followersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/following_url`. + public var followingUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/gists_url`. + public var gistsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/id`. + public var id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/login`. + public var login: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/organizations_url`. + public var organizationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/received_events_url`. + public var receivedEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/repos_url`. + public var reposUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/site_admin`. + public var siteAdmin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/starred_url`. + public var starredUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/subscriptions_url`. + public var subscriptionsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case bot = "Bot" + case user = "User" + case organization = "Organization" + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/type`. + public var _type: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.UserPayload._TypePayload? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - avatarUrl: + /// - deleted: + /// - email: + /// - eventsUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - gravatarId: + /// - htmlUrl: + /// - id: + /// - login: + /// - name: + /// - nodeId: + /// - organizationsUrl: + /// - receivedEventsUrl: + /// - reposUrl: + /// - siteAdmin: + /// - starredUrl: + /// - subscriptionsUrl: + /// - _type: + /// - url: + /// - userViewType: + public init( + avatarUrl: Swift.String? = nil, + deleted: Swift.Bool? = nil, + email: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + followersUrl: Swift.String? = nil, + followingUrl: Swift.String? = nil, + gistsUrl: Swift.String? = nil, + gravatarId: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + id: Swift.Int64? = nil, + login: Swift.String? = nil, + name: Swift.String? = nil, + nodeId: Swift.String? = nil, + organizationsUrl: Swift.String? = nil, + receivedEventsUrl: Swift.String? = nil, + reposUrl: Swift.String? = nil, + siteAdmin: Swift.Bool? = nil, + starredUrl: Swift.String? = nil, + subscriptionsUrl: Swift.String? = nil, + _type: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.UserPayload._TypePayload? = nil, + url: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.avatarUrl = avatarUrl + self.deleted = deleted + self.email = email + self.eventsUrl = eventsUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.gravatarId = gravatarId + self.htmlUrl = htmlUrl + self.id = id + self.login = login + self.name = name + self.nodeId = nodeId + self.organizationsUrl = organizationsUrl + self.receivedEventsUrl = receivedEventsUrl + self.reposUrl = reposUrl + self.siteAdmin = siteAdmin + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self._type = _type + self.url = url + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case avatarUrl = "avatar_url" + case deleted + case email + case eventsUrl = "events_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case gravatarId = "gravatar_id" + case htmlUrl = "html_url" + case id + case login + case name + case nodeId = "node_id" + case organizationsUrl = "organizations_url" + case receivedEventsUrl = "received_events_url" + case reposUrl = "repos_url" + case siteAdmin = "site_admin" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case _type = "type" + case url + case userViewType = "user_view_type" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/user`. + public var user: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.UserPayload? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/body`. + public var body: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/pull_request_url`. + public var pullRequestUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/html`. + public struct HtmlPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/html/href`. + public var href: Swift.String + /// Creates a new `HtmlPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/html`. + public var html: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload.HtmlPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/pull_request/href`. + public var href: Swift.String + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/pull_request`. + public var pullRequest: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload.PullRequestPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/self`. + public struct _SelfPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/self/href`. + public var href: Swift.String + /// Creates a new `_SelfPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links/self`. + public var _self: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload._SelfPayload + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - html: + /// - pullRequest: + /// - _self: + public init( + html: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload.HtmlPayload, + pullRequest: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload.PullRequestPayload, + _self: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload._SelfPayload + ) { + self.html = html + self.pullRequest = pullRequest + self._self = _self + } + public enum CodingKeys: String, CodingKey { + case html + case pullRequest = "pull_request" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/_links`. + public var _links: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/original_commit_id`. + public var originalCommitId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions`. + public struct ReactionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/+1`. + public var _plus_1: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/-1`. + public var _hyphen_1: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/confused`. + public var confused: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/eyes`. + public var eyes: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/heart`. + public var heart: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/hooray`. + public var hooray: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/laugh`. + public var laugh: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/rocket`. + public var rocket: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions/url`. + public var url: Swift.String? + /// Creates a new `ReactionsPayload`. + /// + /// - Parameters: + /// - _plus_1: + /// - _hyphen_1: + /// - confused: + /// - eyes: + /// - heart: + /// - hooray: + /// - laugh: + /// - rocket: + /// - totalCount: + /// - url: + public init( + _plus_1: Swift.Int? = nil, + _hyphen_1: Swift.Int? = nil, + confused: Swift.Int? = nil, + eyes: Swift.Int? = nil, + heart: Swift.Int? = nil, + hooray: Swift.Int? = nil, + laugh: Swift.Int? = nil, + rocket: Swift.Int? = nil, + totalCount: Swift.Int? = nil, + url: Swift.String? = nil + ) { + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.confused = confused + self.eyes = eyes + self.heart = heart + self.hooray = hooray + self.laugh = laugh + self.rocket = rocket + self.totalCount = totalCount + self.url = url + } + public enum CodingKeys: String, CodingKey { + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case confused + case eyes + case heart + case hooray + case laugh + case rocket + case totalCount = "total_count" + case url + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/reactions`. + public var reactions: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.ReactionsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment/in_reply_to_id`. + public var inReplyToId: Swift.Int? + /// Creates a new `CommentPayload`. /// /// - Parameters: - /// - title: + /// - id: + /// - nodeId: /// - url: - /// - latestCommentUrl: - /// - _type: + /// - pullRequestReviewId: + /// - diffHunk: + /// - path: + /// - position: + /// - originalPosition: + /// - subjectType: + /// - commitId: + /// - user: + /// - body: + /// - createdAt: + /// - updatedAt: + /// - htmlUrl: + /// - pullRequestUrl: + /// - _links: + /// - originalCommitId: + /// - reactions: + /// - inReplyToId: public init( - title: Swift.String, + id: Swift.Int, + nodeId: Swift.String, url: Swift.String, - latestCommentUrl: Swift.String, - _type: Swift.String + pullRequestReviewId: Swift.Int? = nil, + diffHunk: Swift.String, + path: Swift.String, + position: Swift.Int? = nil, + originalPosition: Swift.Int, + subjectType: Swift.String? = nil, + commitId: Swift.String, + user: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.UserPayload? = nil, + body: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + htmlUrl: Swift.String, + pullRequestUrl: Swift.String, + _links: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload._LinksPayload, + originalCommitId: Swift.String, + reactions: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload.ReactionsPayload, + inReplyToId: Swift.Int? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.pullRequestReviewId = pullRequestReviewId + self.diffHunk = diffHunk + self.path = path + self.position = position + self.originalPosition = originalPosition + self.subjectType = subjectType + self.commitId = commitId + self.user = user + self.body = body + self.createdAt = createdAt + self.updatedAt = updatedAt + self.htmlUrl = htmlUrl + self.pullRequestUrl = pullRequestUrl + self._links = _links + self.originalCommitId = originalCommitId + self.reactions = reactions + self.inReplyToId = inReplyToId + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case pullRequestReviewId = "pull_request_review_id" + case diffHunk = "diff_hunk" + case path + case position + case originalPosition = "original_position" + case subjectType = "subject_type" + case commitId = "commit_id" + case user + case body + case createdAt = "created_at" + case updatedAt = "updated_at" + case htmlUrl = "html_url" + case pullRequestUrl = "pull_request_url" + case _links + case originalCommitId = "original_commit_id" + case reactions + case inReplyToId = "in_reply_to_id" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment-event/comment`. + public var comment: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload + /// Creates a new `PullRequestReviewCommentEvent`. + /// + /// - Parameters: + /// - action: + /// - pullRequest: + /// - comment: + public init( + action: Swift.String, + pullRequest: Components.Schemas.PullRequestMinimal, + comment: Components.Schemas.PullRequestReviewCommentEvent.CommentPayload + ) { + self.action = action + self.pullRequest = pullRequest + self.comment = comment + } + public enum CodingKeys: String, CodingKey { + case action + case pullRequest = "pull_request" + case comment + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-event`. + public struct PullRequestReviewEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review`. + public struct ReviewPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/submitted_at`. + public var submittedAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/state`. + public var state: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/pull_request_url`. + public var pullRequestUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/html`. + public struct HtmlPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/html/href`. + public var href: Swift.String + /// Creates a new `HtmlPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/html`. + public var html: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload.HtmlPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/pull_request/href`. + public var href: Swift.String + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links/pull_request`. + public var pullRequest: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload.PullRequestPayload + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - html: + /// - pullRequest: + public init( + html: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload.HtmlPayload, + pullRequest: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload.PullRequestPayload + ) { + self.html = html + self.pullRequest = pullRequest + } + public enum CodingKeys: String, CodingKey { + case html + case pullRequest = "pull_request" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/_links`. + public var _links: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload? + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `ReviewPayload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - user: + /// - body: + /// - commitId: + /// - submittedAt: + /// - state: + /// - htmlUrl: + /// - pullRequestUrl: + /// - _links: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + nodeId: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + commitId: Swift.String? = nil, + submittedAt: Swift.String? = nil, + state: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + pullRequestUrl: Swift.String? = nil, + _links: Components.Schemas.PullRequestReviewEvent.ReviewPayload._LinksPayload? = nil, + updatedAt: Swift.String? = nil ) { - self.title = title - self.url = url - self.latestCommentUrl = latestCommentUrl - self._type = _type + self.id = id + self.nodeId = nodeId + self.user = user + self.body = body + self.commitId = commitId + self.submittedAt = submittedAt + self.state = state + self.htmlUrl = htmlUrl + self.pullRequestUrl = pullRequestUrl + self._links = _links + self.updatedAt = updatedAt } public enum CodingKeys: String, CodingKey { - case title - case url - case latestCommentUrl = "latest_comment_url" - case _type = "type" + case id + case nodeId = "node_id" + case user + case body + case commitId = "commit_id" + case submittedAt = "submitted_at" + case state + case htmlUrl = "html_url" + case pullRequestUrl = "pull_request_url" + case _links + case updatedAt = "updated_at" } } - /// - Remark: Generated from `#/components/schemas/thread/subject`. - public var subject: Components.Schemas.Thread.SubjectPayload - /// - Remark: Generated from `#/components/schemas/thread/reason`. - public var reason: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/unread`. - public var unread: Swift.Bool - /// - Remark: Generated from `#/components/schemas/thread/updated_at`. - public var updatedAt: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/last_read_at`. - public var lastReadAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/thread/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/thread/subscription_url`. - public var subscriptionUrl: Swift.String - /// Creates a new `Thread`. + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/review`. + public var review: Components.Schemas.PullRequestReviewEvent.ReviewPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-event/pull_request`. + public var pullRequest: Components.Schemas.PullRequestMinimal + /// Creates a new `PullRequestReviewEvent`. /// /// - Parameters: - /// - id: - /// - repository: - /// - subject: - /// - reason: - /// - unread: - /// - updatedAt: - /// - lastReadAt: - /// - url: - /// - subscriptionUrl: + /// - action: + /// - review: + /// - pullRequest: public init( - id: Swift.String, - repository: Components.Schemas.MinimalRepository, - subject: Components.Schemas.Thread.SubjectPayload, - reason: Swift.String, - unread: Swift.Bool, - updatedAt: Swift.String, - lastReadAt: Swift.String? = nil, - url: Swift.String, - subscriptionUrl: Swift.String + action: Swift.String, + review: Components.Schemas.PullRequestReviewEvent.ReviewPayload, + pullRequest: Components.Schemas.PullRequestMinimal ) { - self.id = id - self.repository = repository - self.subject = subject - self.reason = reason - self.unread = unread - self.updatedAt = updatedAt - self.lastReadAt = lastReadAt - self.url = url - self.subscriptionUrl = subscriptionUrl + self.action = action + self.review = review + self.pullRequest = pullRequest } public enum CodingKeys: String, CodingKey { - case id - case repository - case subject - case reason - case unread - case updatedAt = "updated_at" - case lastReadAt = "last_read_at" - case url - case subscriptionUrl = "subscription_url" + case action + case review + case pullRequest = "pull_request" } } - /// Thread Subscription - /// - /// - Remark: Generated from `#/components/schemas/thread-subscription`. - public struct ThreadSubscription: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/thread-subscription/subscribed`. - public var subscribed: Swift.Bool - /// - Remark: Generated from `#/components/schemas/thread-subscription/ignored`. - public var ignored: Swift.Bool - /// - Remark: Generated from `#/components/schemas/thread-subscription/reason`. - public var reason: Swift.String? - /// - Remark: Generated from `#/components/schemas/thread-subscription/created_at`. - public var createdAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/thread-subscription/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/thread-subscription/thread_url`. - public var threadUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/thread-subscription/repository_url`. - public var repositoryUrl: Swift.String? - /// Creates a new `ThreadSubscription`. - /// - /// - Parameters: - /// - subscribed: - /// - ignored: - /// - reason: - /// - createdAt: - /// - url: - /// - threadUrl: - /// - repositoryUrl: - public init( - subscribed: Swift.Bool, - ignored: Swift.Bool, - reason: Swift.String? = nil, - createdAt: Foundation.Date? = nil, - url: Swift.String, - threadUrl: Swift.String? = nil, - repositoryUrl: Swift.String? = nil - ) { - self.subscribed = subscribed - self.ignored = ignored - self.reason = reason - self.createdAt = createdAt - self.url = url - self.threadUrl = threadUrl - self.repositoryUrl = repositoryUrl - } - public enum CodingKeys: String, CodingKey { - case subscribed - case ignored - case reason - case createdAt = "created_at" - case url - case threadUrl = "thread_url" - case repositoryUrl = "repository_url" + /// - Remark: Generated from `#/components/schemas/commit-comment-event`. + public struct CommitCommentEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit-comment-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment`. + public struct CommentPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/path`. + public var path: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/position`. + public var position: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/line`. + public var line: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// Creates a new `CommentPayload`. + /// + /// - Parameters: + /// - htmlUrl: + /// - url: + /// - id: + /// - nodeId: + /// - body: + /// - path: + /// - position: + /// - line: + /// - commitId: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - reactions: + public init( + htmlUrl: Swift.String? = nil, + url: Swift.String? = nil, + id: Swift.Int? = nil, + nodeId: Swift.String? = nil, + body: Swift.String? = nil, + path: Swift.String? = nil, + position: Swift.Int? = nil, + line: Swift.Int? = nil, + commitId: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + reactions: Components.Schemas.ReactionRollup? = nil + ) { + self.htmlUrl = htmlUrl + self.url = url + self.id = id + self.nodeId = nodeId + self.body = body + self.path = path + self.position = position + self.line = line + self.commitId = commitId + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + self.reactions = reactions + } + public enum CodingKeys: String, CodingKey { + case htmlUrl = "html_url" + case url + case id + case nodeId = "node_id" + case body + case path + case position + case line + case commitId = "commit_id" + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + case reactions + } } - } - /// Stargazer - /// - /// - Remark: Generated from `#/components/schemas/stargazer`. - public struct Stargazer: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/stargazer/starred_at`. - public var starredAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/stargazer/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `Stargazer`. + /// - Remark: Generated from `#/components/schemas/commit-comment-event/comment`. + public var comment: Components.Schemas.CommitCommentEvent.CommentPayload + /// Creates a new `CommitCommentEvent`. /// /// - Parameters: - /// - starredAt: - /// - user: + /// - action: + /// - comment: public init( - starredAt: Foundation.Date, - user: Components.Schemas.NullableSimpleUser? = nil + action: Swift.String, + comment: Components.Schemas.CommitCommentEvent.CommentPayload ) { - self.starredAt = starredAt - self.user = user + self.action = action + self.comment = comment } public enum CodingKeys: String, CodingKey { - case starredAt = "starred_at" - case user + case action + case comment + } + } + /// - Remark: Generated from `#/components/schemas/release-event`. + public struct ReleaseEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release-event/action`. + public var action: Swift.String + /// - Remark: Generated from `#/components/schemas/release-event/release`. + public struct ReleasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release-event/release/value1`. + public var value1: Components.Schemas.Release + /// - Remark: Generated from `#/components/schemas/release-event/release/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release-event/release/value2/is_short_description_html_truncated`. + public var isShortDescriptionHtmlTruncated: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/release-event/release/value2/short_description_html`. + public var shortDescriptionHtml: Swift.String? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - isShortDescriptionHtmlTruncated: + /// - shortDescriptionHtml: + public init( + isShortDescriptionHtmlTruncated: Swift.Bool? = nil, + shortDescriptionHtml: Swift.String? = nil + ) { + self.isShortDescriptionHtmlTruncated = isShortDescriptionHtmlTruncated + self.shortDescriptionHtml = shortDescriptionHtml + } + public enum CodingKeys: String, CodingKey { + case isShortDescriptionHtmlTruncated = "is_short_description_html_truncated" + case shortDescriptionHtml = "short_description_html" + } + } + /// - Remark: Generated from `#/components/schemas/release-event/release/value2`. + public var value2: Components.Schemas.ReleaseEvent.ReleasePayload.Value2Payload + /// Creates a new `ReleasePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.Release, + value2: Components.Schemas.ReleaseEvent.ReleasePayload.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } } - } - /// Repository invitations let you manage who you collaborate with. - /// - /// - Remark: Generated from `#/components/schemas/repository-subscription`. - public struct RepositorySubscription: Codable, Hashable, Sendable { - /// Determines if notifications should be received from this repository. - /// - /// - Remark: Generated from `#/components/schemas/repository-subscription/subscribed`. - public var subscribed: Swift.Bool - /// Determines if all notifications should be blocked from this repository. - /// - /// - Remark: Generated from `#/components/schemas/repository-subscription/ignored`. - public var ignored: Swift.Bool - /// - Remark: Generated from `#/components/schemas/repository-subscription/reason`. - public var reason: Swift.String? - /// - Remark: Generated from `#/components/schemas/repository-subscription/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/repository-subscription/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-subscription/repository_url`. - public var repositoryUrl: Swift.String - /// Creates a new `RepositorySubscription`. + /// - Remark: Generated from `#/components/schemas/release-event/release`. + public var release: Components.Schemas.ReleaseEvent.ReleasePayload + /// Creates a new `ReleaseEvent`. /// /// - Parameters: - /// - subscribed: Determines if notifications should be received from this repository. - /// - ignored: Determines if all notifications should be blocked from this repository. - /// - reason: - /// - createdAt: - /// - url: - /// - repositoryUrl: + /// - action: + /// - release: public init( - subscribed: Swift.Bool, - ignored: Swift.Bool, - reason: Swift.String? = nil, - createdAt: Foundation.Date, - url: Swift.String, - repositoryUrl: Swift.String + action: Swift.String, + release: Components.Schemas.ReleaseEvent.ReleasePayload ) { - self.subscribed = subscribed - self.ignored = ignored - self.reason = reason - self.createdAt = createdAt - self.url = url - self.repositoryUrl = repositoryUrl + self.action = action + self.release = release } public enum CodingKeys: String, CodingKey { - case subscribed - case ignored - case reason - case createdAt = "created_at" - case url - case repositoryUrl = "repository_url" + case action + case release } } - /// Starred Repository - /// - /// - Remark: Generated from `#/components/schemas/starred-repository`. - public struct StarredRepository: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/starred-repository/starred_at`. - public var starredAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/starred-repository/repo`. - public var repo: Components.Schemas.Repository - /// Creates a new `StarredRepository`. + /// - Remark: Generated from `#/components/schemas/watch-event`. + public struct WatchEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/watch-event/action`. + public var action: Swift.String + /// Creates a new `WatchEvent`. /// /// - Parameters: - /// - starredAt: - /// - repo: - public init( - starredAt: Foundation.Date, - repo: Components.Schemas.Repository - ) { - self.starredAt = starredAt - self.repo = repo + /// - action: + public init(action: Swift.String) { + self.action = action } public enum CodingKeys: String, CodingKey { - case starredAt = "starred_at" - case repo + case action } } } @@ -8493,8 +11759,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -8515,7 +11781,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2 @@ -11466,8 +14732,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -11488,7 +14754,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2 From 75ec1563ade6aa09b1ce1186234d6c951ae7d8ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:05:18 +0000 Subject: [PATCH 04/33] Commit via running: make Sources/apps --- Sources/apps/Types.swift | 223 +++++++++++++++++++++++++++++++-------- 1 file changed, 177 insertions(+), 46 deletions(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 5e7f4791eb..4248129919 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -1304,8 +1304,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -1324,7 +1324,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -1396,7 +1396,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -1426,7 +1426,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -1548,8 +1548,8 @@ public enum Components { case case1(Swift.String) /// - Remark: Generated from `#/components/schemas/webhook-config-insecure-ssl/case2`. case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1568,7 +1568,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1800,8 +1800,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1826,7 +1826,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1968,10 +1968,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -1992,10 +1992,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2037,10 +2037,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2168,8 +2168,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -2190,7 +2190,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -2256,6 +2256,28 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/administration`. public var administration: Components.Schemas.AppPermissions.AdministrationPayload? + /// The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/artifact_metadata`. + @frozen public enum ArtifactMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/artifact_metadata`. + public var artifactMetadata: Components.Schemas.AppPermissions.ArtifactMetadataPayload? + /// The level of permission to create and retrieve the access token for repository attestations. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/attestations`. + @frozen public enum AttestationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to create and retrieve the access token for repository attestations. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/attestations`. + public var attestations: Components.Schemas.AppPermissions.AttestationsPayload? /// The level of permission to grant the access token for checks on code. /// /// - Remark: Generated from `#/components/schemas/app-permissions/checks`. @@ -2311,6 +2333,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/deployments`. public var deployments: Components.Schemas.AppPermissions.DeploymentsPayload? + /// The level of permission to grant the access token for discussions and related comments and labels. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/discussions`. + @frozen public enum DiscussionsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token for discussions and related comments and labels. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/discussions`. + public var discussions: Components.Schemas.AppPermissions.DiscussionsPayload? /// The level of permission to grant the access token for managing repository environments. /// /// - Remark: Generated from `#/components/schemas/app-permissions/environments`. @@ -2333,6 +2366,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/issues`. public var issues: Components.Schemas.AppPermissions.IssuesPayload? + /// The level of permission to grant the access token to manage the merge queues for a repository. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/merge_queues`. + @frozen public enum MergeQueuesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to manage the merge queues for a repository. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/merge_queues`. + public var mergeQueues: Components.Schemas.AppPermissions.MergeQueuesPayload? /// The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. /// /// - Remark: Generated from `#/components/schemas/app-permissions/metadata`. @@ -2564,6 +2608,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. public var organizationCopilotSeatManagement: Components.Schemas.AppPermissions.OrganizationCopilotSeatManagementPayload? + /// The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_agent_settings`. + @frozen public enum OrganizationCopilotAgentSettingsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_agent_settings`. + public var organizationCopilotAgentSettings: Components.Schemas.AppPermissions.OrganizationCopilotAgentSettingsPayload? /// The level of permission to grant the access token to view and manage announcement banners for an organization. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_announcement_banners`. @@ -2684,17 +2739,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_user_blocking`. public var organizationUserBlocking: Components.Schemas.AppPermissions.OrganizationUserBlockingPayload? - /// The level of permission to grant the access token to manage team discussions and related comments. - /// - /// - Remark: Generated from `#/components/schemas/app-permissions/team_discussions`. - @frozen public enum TeamDiscussionsPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - } - /// The level of permission to grant the access token to manage team discussions and related comments. - /// - /// - Remark: Generated from `#/components/schemas/app-permissions/team_discussions`. - public var teamDiscussions: Components.Schemas.AppPermissions.TeamDiscussionsPayload? /// The level of permission to grant the access token to manage the email addresses belonging to a user. /// /// - Remark: Generated from `#/components/schemas/app-permissions/email_addresses`. @@ -2788,13 +2832,17 @@ public enum Components { /// - Parameters: /// - actions: The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. /// - administration: The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. + /// - artifactMetadata: The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// - attestations: The level of permission to create and retrieve the access token for repository attestations. /// - checks: The level of permission to grant the access token for checks on code. /// - codespaces: The level of permission to grant the access token to create, edit, delete, and list Codespaces. /// - contents: The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. /// - dependabotSecrets: The level of permission to grant the access token to manage Dependabot secrets. /// - deployments: The level of permission to grant the access token for deployments and deployment statuses. + /// - discussions: The level of permission to grant the access token for discussions and related comments and labels. /// - environments: The level of permission to grant the access token for managing repository environments. /// - issues: The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. + /// - mergeQueues: The level of permission to grant the access token to manage the merge queues for a repository. /// - metadata: The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. /// - packages: The level of permission to grant the access token for packages published to GitHub Packages. /// - pages: The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. @@ -2816,6 +2864,7 @@ public enum Components { /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. + /// - organizationCopilotAgentSettings: The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. /// - organizationHooks: The level of permission to grant the access token to manage the post-receive hooks for an organization. @@ -2827,7 +2876,6 @@ public enum Components { /// - organizationSecrets: The level of permission to grant the access token to manage organization secrets. /// - organizationSelfHostedRunners: The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. /// - organizationUserBlocking: The level of permission to grant the access token to view and manage users blocked by the organization. - /// - teamDiscussions: The level of permission to grant the access token to manage team discussions and related comments. /// - emailAddresses: The level of permission to grant the access token to manage the email addresses belonging to a user. /// - followers: The level of permission to grant the access token to manage the followers belonging to a user. /// - gitSshKeys: The level of permission to grant the access token to manage git SSH keys. @@ -2839,13 +2887,17 @@ public enum Components { public init( actions: Components.Schemas.AppPermissions.ActionsPayload? = nil, administration: Components.Schemas.AppPermissions.AdministrationPayload? = nil, + artifactMetadata: Components.Schemas.AppPermissions.ArtifactMetadataPayload? = nil, + attestations: Components.Schemas.AppPermissions.AttestationsPayload? = nil, checks: Components.Schemas.AppPermissions.ChecksPayload? = nil, codespaces: Components.Schemas.AppPermissions.CodespacesPayload? = nil, contents: Components.Schemas.AppPermissions.ContentsPayload? = nil, dependabotSecrets: Components.Schemas.AppPermissions.DependabotSecretsPayload? = nil, deployments: Components.Schemas.AppPermissions.DeploymentsPayload? = nil, + discussions: Components.Schemas.AppPermissions.DiscussionsPayload? = nil, environments: Components.Schemas.AppPermissions.EnvironmentsPayload? = nil, issues: Components.Schemas.AppPermissions.IssuesPayload? = nil, + mergeQueues: Components.Schemas.AppPermissions.MergeQueuesPayload? = nil, metadata: Components.Schemas.AppPermissions.MetadataPayload? = nil, packages: Components.Schemas.AppPermissions.PackagesPayload? = nil, pages: Components.Schemas.AppPermissions.PagesPayload? = nil, @@ -2867,6 +2919,7 @@ public enum Components { organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? = nil, organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? = nil, organizationCopilotSeatManagement: Components.Schemas.AppPermissions.OrganizationCopilotSeatManagementPayload? = nil, + organizationCopilotAgentSettings: Components.Schemas.AppPermissions.OrganizationCopilotAgentSettingsPayload? = nil, organizationAnnouncementBanners: Components.Schemas.AppPermissions.OrganizationAnnouncementBannersPayload? = nil, organizationEvents: Components.Schemas.AppPermissions.OrganizationEventsPayload? = nil, organizationHooks: Components.Schemas.AppPermissions.OrganizationHooksPayload? = nil, @@ -2878,7 +2931,6 @@ public enum Components { organizationSecrets: Components.Schemas.AppPermissions.OrganizationSecretsPayload? = nil, organizationSelfHostedRunners: Components.Schemas.AppPermissions.OrganizationSelfHostedRunnersPayload? = nil, organizationUserBlocking: Components.Schemas.AppPermissions.OrganizationUserBlockingPayload? = nil, - teamDiscussions: Components.Schemas.AppPermissions.TeamDiscussionsPayload? = nil, emailAddresses: Components.Schemas.AppPermissions.EmailAddressesPayload? = nil, followers: Components.Schemas.AppPermissions.FollowersPayload? = nil, gitSshKeys: Components.Schemas.AppPermissions.GitSshKeysPayload? = nil, @@ -2890,13 +2942,17 @@ public enum Components { ) { self.actions = actions self.administration = administration + self.artifactMetadata = artifactMetadata + self.attestations = attestations self.checks = checks self.codespaces = codespaces self.contents = contents self.dependabotSecrets = dependabotSecrets self.deployments = deployments + self.discussions = discussions self.environments = environments self.issues = issues + self.mergeQueues = mergeQueues self.metadata = metadata self.packages = packages self.pages = pages @@ -2918,6 +2974,7 @@ public enum Components { self.organizationCustomOrgRoles = organizationCustomOrgRoles self.organizationCustomProperties = organizationCustomProperties self.organizationCopilotSeatManagement = organizationCopilotSeatManagement + self.organizationCopilotAgentSettings = organizationCopilotAgentSettings self.organizationAnnouncementBanners = organizationAnnouncementBanners self.organizationEvents = organizationEvents self.organizationHooks = organizationHooks @@ -2929,7 +2986,6 @@ public enum Components { self.organizationSecrets = organizationSecrets self.organizationSelfHostedRunners = organizationSelfHostedRunners self.organizationUserBlocking = organizationUserBlocking - self.teamDiscussions = teamDiscussions self.emailAddresses = emailAddresses self.followers = followers self.gitSshKeys = gitSshKeys @@ -2942,13 +2998,17 @@ public enum Components { public enum CodingKeys: String, CodingKey { case actions case administration + case artifactMetadata = "artifact_metadata" + case attestations case checks case codespaces case contents case dependabotSecrets = "dependabot_secrets" case deployments + case discussions case environments case issues + case mergeQueues = "merge_queues" case metadata case packages case pages @@ -2970,6 +3030,7 @@ public enum Components { case organizationCustomOrgRoles = "organization_custom_org_roles" case organizationCustomProperties = "organization_custom_properties" case organizationCopilotSeatManagement = "organization_copilot_seat_management" + case organizationCopilotAgentSettings = "organization_copilot_agent_settings" case organizationAnnouncementBanners = "organization_announcement_banners" case organizationEvents = "organization_events" case organizationHooks = "organization_hooks" @@ -2981,7 +3042,6 @@ public enum Components { case organizationSecrets = "organization_secrets" case organizationSelfHostedRunners = "organization_self_hosted_runners" case organizationUserBlocking = "organization_user_blocking" - case teamDiscussions = "team_discussions" case emailAddresses = "email_addresses" case followers case gitSshKeys = "git_ssh_keys" @@ -3163,8 +3223,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -3185,7 +3245,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -3591,6 +3651,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -3836,6 +3915,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -3933,6 +4015,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4030,6 +4115,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4128,6 +4216,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5331,7 +5422,7 @@ public enum Operations { case webhookSecret = "webhook_secret" case pem } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.clientId = try container.decode( Swift.String.self, @@ -5356,7 +5447,7 @@ public enum Operations { "pem" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode( self.clientId, @@ -5391,11 +5482,11 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -8822,8 +8913,28 @@ public enum Operations { public struct JsonPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/RepositoriesPayload`. + public struct RepositoriesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/RepositoriesPayload/value1`. + public var value1: Components.Schemas.Repository + /// Creates a new `RepositoriesPayloadPayload`. + /// + /// - Parameters: + /// - value1: + public init(value1: Components.Schemas.Repository) { + self.value1 = value1 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/repositories`. + public typealias RepositoriesPayload = [Operations.AppsListReposAccessibleToInstallation.Output.Ok.Body.JsonPayload.RepositoriesPayloadPayload] /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.Repository] + public var repositories: Operations.AppsListReposAccessibleToInstallation.Output.Ok.Body.JsonPayload.RepositoriesPayload /// - Remark: Generated from `#/paths/installation/repositories/GET/responses/200/content/json/repository_selection`. public var repositorySelection: Swift.String? /// Creates a new `JsonPayload`. @@ -8834,7 +8945,7 @@ public enum Operations { /// - repositorySelection: public init( totalCount: Swift.Int, - repositories: [Components.Schemas.Repository], + repositories: Operations.AppsListReposAccessibleToInstallation.Output.Ok.Body.JsonPayload.RepositoriesPayload, repositorySelection: Swift.String? = nil ) { self.totalCount = totalCount @@ -11048,8 +11159,28 @@ public enum Operations { public var totalCount: Swift.Int /// - Remark: Generated from `#/paths/user/installations/{installation_id}/repositories/GET/responses/200/content/json/repository_selection`. public var repositorySelection: Swift.String? + /// - Remark: Generated from `#/paths/user/installations/{installation_id}/repositories/GET/responses/200/content/json/RepositoriesPayload`. + public struct RepositoriesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/user/installations/{installation_id}/repositories/GET/responses/200/content/json/RepositoriesPayload/value1`. + public var value1: Components.Schemas.Repository + /// Creates a new `RepositoriesPayloadPayload`. + /// + /// - Parameters: + /// - value1: + public init(value1: Components.Schemas.Repository) { + self.value1 = value1 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/user/installations/{installation_id}/repositories/GET/responses/200/content/json/repositories`. + public typealias RepositoriesPayload = [Operations.AppsListInstallationReposForAuthenticatedUser.Output.Ok.Body.JsonPayload.RepositoriesPayloadPayload] /// - Remark: Generated from `#/paths/user/installations/{installation_id}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.Repository] + public var repositories: Operations.AppsListInstallationReposForAuthenticatedUser.Output.Ok.Body.JsonPayload.RepositoriesPayload /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -11059,7 +11190,7 @@ public enum Operations { public init( totalCount: Swift.Int, repositorySelection: Swift.String? = nil, - repositories: [Components.Schemas.Repository] + repositories: Operations.AppsListInstallationReposForAuthenticatedUser.Output.Ok.Body.JsonPayload.RepositoriesPayload ) { self.totalCount = totalCount self.repositorySelection = repositorySelection From ce757589347039d9c1245cfaa3fc5971f3ae5554 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:05:40 +0000 Subject: [PATCH 05/33] Commit via running: make Sources/billing --- Sources/billing/Client.swift | 1285 ++++++++--- Sources/billing/Types.swift | 4151 +++++++++++++++++++++++++--------- 2 files changed, 4052 insertions(+), 1384 deletions(-) diff --git a/Sources/billing/Client.swift b/Sources/billing/Client.swift index 1db7191eeb..c8f429c1ab 100644 --- a/Sources/billing/Client.swift +++ b/Sources/billing/Client.swift @@ -38,6 +38,753 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get all budgets for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager. + /// Each page returns up to 10 budgets. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`. + public func billingGetAllBudgetsOrg(_ input: Operations.BillingGetAllBudgetsOrg.Input) async throws -> Operations.BillingGetAllBudgetsOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetAllBudgetsOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/budgets", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "scope", + value: input.query.scope + ) + 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.GetAllBudgets.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.GetAllBudgets.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 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 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a budget by ID for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets a budget by ID. The authenticated user must be an organization admin or billing manager. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`. + public func billingGetBudgetOrg(_ input: Operations.BillingGetBudgetOrg.Input) async throws -> Operations.BillingGetBudgetOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetBudgetOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/budgets/{}", + parameters: [ + input.path.org, + input.path.budgetId + ] + ) + 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.Budget.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.GetBudget.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a budget for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager. + /// + /// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`. + public func billingUpdateBudgetOrg(_ input: Operations.BillingUpdateBudgetOrg.Input) async throws -> Operations.BillingUpdateBudgetOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingUpdateBudgetOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/budgets/{}", + parameters: [ + input.path.org, + input.path.budgetId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.BillingUpdateBudgetOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.BillingUpdateBudgetOrg.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.BillingUpdateBudgetOrg.Output.InternalServerError.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 .internalServerError(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a budget for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager. + /// + /// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`. + public func billingDeleteBudgetOrg(_ input: Operations.BillingDeleteBudgetOrg.Input) async throws -> Operations.BillingDeleteBudgetOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingDeleteBudgetOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/budgets/{}", + parameters: [ + input.path.org, + input.path.budgetId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.DeleteBudget.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.DeleteBudget.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get billing premium request usage report for an organization /// /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -310,13 +1057,6 @@ public struct Client: APIProtocol { name: "day", value: input.query.day ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "hour", - value: input.query.hour - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -456,23 +1196,24 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions billing for an organization + /// Get billing usage summary for an organization /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. - public func billingGetGithubActionsBillingOrg(_ input: Operations.BillingGetGithubActionsBillingOrg.Input) async throws -> Operations.BillingGetGithubActionsBillingOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`. + public func billingGetGithubBillingUsageSummaryReportOrg(_ input: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportOrg.Output { try await client.send( input: input, - forOperation: Operations.BillingGetGithubActionsBillingOrg.id, + forOperation: Operations.BillingGetGithubBillingUsageSummaryReportOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/settings/billing/actions", + template: "/organizations/{}/settings/billing/usage/summary", parameters: [ input.path.org ] @@ -482,74 +1223,48 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetGithubActionsBillingOrg.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.ActionsBillingUsage.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get GitHub Packages billing for an organization - /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. - public func billingGetGithubPackagesBillingOrg(_ input: Operations.BillingGetGithubPackagesBillingOrg.Input) async throws -> Operations.BillingGetGithubPackagesBillingOrg.Output { - try await client.send( - input: input, - forOperation: Operations.BillingGetGithubPackagesBillingOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/settings/billing/packages", - parameters: [ - input.path.org - ] + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "repository", + value: input.query.repository + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sku", + value: input.query.sku ) - suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -560,7 +1275,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body + let body: Components.Responses.BillingUsageSummaryReportOrg.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -570,7 +1285,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.PackagesBillingUsage.self, + Components.Schemas.BillingUsageSummaryReportOrg.self, from: responseBody, transforming: { value in .json(value) @@ -580,123 +1295,40 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get shared storage billing for an organization - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. - public func billingGetSharedStorageBillingOrg(_ input: Operations.BillingGetSharedStorageBillingOrg.Input) async throws -> Operations.BillingGetSharedStorageBillingOrg.Output { - try await client.send( - input: input, - forOperation: Operations.BillingGetSharedStorageBillingOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/settings/billing/shared-storage", - 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: + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CombinedBillingUsage.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get GitHub Actions billing for a user - /// - /// Gets the summary of the free and paid GitHub Actions minutes used. - /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". - /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. - public func billingGetGithubActionsBillingUser(_ input: Operations.BillingGetGithubActionsBillingUser.Input) async throws -> Operations.BillingGetGithubActionsBillingUser.Output { - try await client.send( - input: input, - forOperation: Operations.BillingGetGithubActionsBillingUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/users/{}/settings/billing/actions", - parameters: [ - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -706,7 +1338,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsBillingUsage.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -715,56 +1347,32 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + return .forbidden(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Get GitHub Packages billing for a user - /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. - public func billingGetGithubPackagesBillingUser(_ input: Operations.BillingGetGithubPackagesBillingUser.Input) async throws -> Operations.BillingGetGithubPackagesBillingUser.Output { - try await client.send( - input: input, - forOperation: Operations.BillingGetGithubPackagesBillingUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/users/{}/settings/billing/packages", - parameters: [ - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + 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 .internalServerError(.init(body: body)) + case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body + let body: Components.Responses.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -774,7 +1382,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.PackagesBillingUsage.self, + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -783,7 +1391,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1016,23 +1624,21 @@ public struct Client: APIProtocol { } ) } - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Get billing usage report for a user /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of the total usage for a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - public func billingGetSharedStorageBillingUser(_ input: Operations.BillingGetSharedStorageBillingUser.Input) async throws -> Operations.BillingGetSharedStorageBillingUser.Output { + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + public func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output { try await client.send( input: input, - forOperation: Operations.BillingGetSharedStorageBillingUser.id, + forOperation: Operations.BillingGetGithubBillingUsageReportUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/users/{}/settings/billing/shared-storage", + template: "/users/{}/settings/billing/usage", parameters: [ input.path.username ] @@ -1042,6 +1648,27 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1052,7 +1679,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body + let body: Components.Responses.BillingUsageReportUser.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1062,7 +1689,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CombinedBillingUsage.self, + Components.Schemas.BillingUsageReportUser.self, from: responseBody, transforming: { value in .json(value) @@ -1072,6 +1699,103 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 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 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1084,21 +1808,24 @@ public struct Client: APIProtocol { } ) } - /// Get billing usage report for a user + /// Get billing usage summary for a user /// - /// Gets a report of the total usage for a user. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. + /// Gets a summary report of usage for a user. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. - public func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output { + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`. + public func billingGetGithubBillingUsageSummaryReportUser(_ input: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportUser.Output { try await client.send( input: input, - forOperation: Operations.BillingGetGithubBillingUsageReportUser.id, + forOperation: Operations.BillingGetGithubBillingUsageSummaryReportUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/users/{}/settings/billing/usage", + template: "/users/{}/settings/billing/usage/summary", parameters: [ input.path.username ] @@ -1133,8 +1860,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "hour", - value: input.query.hour + name: "repository", + value: input.query.repository + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sku", + value: input.query.sku ) converter.setAcceptHeader( in: &request.headerFields, @@ -1146,7 +1887,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BillingUsageReportUser.Body + let body: Components.Responses.BillingUsageSummaryReportUser.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1156,7 +1897,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BillingUsageReportUser.self, + Components.Schemas.BillingUsageSummaryReportUser.self, from: responseBody, transforming: { value in .json(value) @@ -1219,6 +1960,28 @@ public struct Client: APIProtocol { 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 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 8fca4b3df4..4050470290 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -11,79 +11,77 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// Get billing premium request usage report for an organization - /// - /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. - /// - /// **Note:** Only data from the past 24 months is accessible via this endpoint. - /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. - func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output - /// Get billing usage report for an organization - /// - /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// Get all budgets for an organization /// - /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. - func billingGetGithubBillingUsageReportOrg(_ input: Operations.BillingGetGithubBillingUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output - /// Get GitHub Actions billing for an organization + /// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager. + /// Each page returns up to 10 budgets. /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`. + func billingGetAllBudgetsOrg(_ input: Operations.BillingGetAllBudgetsOrg.Input) async throws -> Operations.BillingGetAllBudgetsOrg.Output + /// Get a budget by ID for an organization /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// Gets a budget by ID. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. - func billingGetGithubActionsBillingOrg(_ input: Operations.BillingGetGithubActionsBillingOrg.Input) async throws -> Operations.BillingGetGithubActionsBillingOrg.Output - /// Get GitHub Packages billing for an organization + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`. + func billingGetBudgetOrg(_ input: Operations.BillingGetBudgetOrg.Input) async throws -> Operations.BillingGetBudgetOrg.Output + /// Update a budget for an organization /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`. + func billingUpdateBudgetOrg(_ input: Operations.BillingUpdateBudgetOrg.Input) async throws -> Operations.BillingUpdateBudgetOrg.Output + /// Delete a budget for an organization /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. - func billingGetGithubPackagesBillingOrg(_ input: Operations.BillingGetGithubPackagesBillingOrg.Input) async throws -> Operations.BillingGetGithubPackagesBillingOrg.Output - /// Get shared storage billing for an organization + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager. /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`. + func billingDeleteBudgetOrg(_ input: Operations.BillingDeleteBudgetOrg.Input) async throws -> Operations.BillingDeleteBudgetOrg.Output + /// Get billing premium request usage report for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. - func billingGetSharedStorageBillingOrg(_ input: Operations.BillingGetSharedStorageBillingOrg.Input) async throws -> Operations.BillingGetSharedStorageBillingOrg.Output - /// Get GitHub Actions billing for a user + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output + /// Get billing usage report for an organization /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. - func billingGetGithubActionsBillingUser(_ input: Operations.BillingGetGithubActionsBillingUser.Input) async throws -> Operations.BillingGetGithubActionsBillingUser.Output - /// Get GitHub Packages billing for a user + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + func billingGetGithubBillingUsageReportOrg(_ input: Operations.BillingGetGithubBillingUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output + /// Get billing usage summary for an organization /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. - func billingGetGithubPackagesBillingUser(_ input: Operations.BillingGetGithubPackagesBillingUser.Input) async throws -> Operations.BillingGetGithubPackagesBillingUser.Output + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`. + func billingGetGithubBillingUsageSummaryReportOrg(_ input: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportOrg.Output /// Get billing premium request usage report for a user /// /// Gets a report of premium request usage for a user. @@ -93,17 +91,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - func billingGetSharedStorageBillingUser(_ input: Operations.BillingGetSharedStorageBillingUser.Input) async throws -> Operations.BillingGetSharedStorageBillingUser.Output /// Get billing usage report for a user /// /// Gets a report of the total usage for a user. @@ -113,140 +100,156 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output + /// Get billing usage summary for a user + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets a summary report of usage for a user. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`. + func billingGetGithubBillingUsageSummaryReportUser(_ input: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportUser.Output } /// Convenience overloads for operation inputs. extension APIProtocol { - /// Get billing premium request usage report for an organization + /// Get all budgets for an organization /// - /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager. + /// Each page returns up to 10 budgets. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. - public func billingGetGithubBillingPremiumRequestUsageReportOrg( - path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, - query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { - try await billingGetGithubBillingPremiumRequestUsageReportOrg(Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input( + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`. + public func billingGetAllBudgetsOrg( + path: Operations.BillingGetAllBudgetsOrg.Input.Path, + query: Operations.BillingGetAllBudgetsOrg.Input.Query = .init(), + headers: Operations.BillingGetAllBudgetsOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetAllBudgetsOrg.Output { + try await billingGetAllBudgetsOrg(Operations.BillingGetAllBudgetsOrg.Input( path: path, query: query, headers: headers )) } - /// Get billing usage report for an organization + /// Get a budget by ID for an organization /// - /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// Gets a budget by ID. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. - public func billingGetGithubBillingUsageReportOrg( - path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, - query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output { - try await billingGetGithubBillingUsageReportOrg(Operations.BillingGetGithubBillingUsageReportOrg.Input( + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`. + public func billingGetBudgetOrg( + path: Operations.BillingGetBudgetOrg.Input.Path, + headers: Operations.BillingGetBudgetOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetBudgetOrg.Output { + try await billingGetBudgetOrg(Operations.BillingGetBudgetOrg.Input( path: path, - query: query, headers: headers )) } - /// Get GitHub Actions billing for an organization - /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// Update a budget for an organization /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. - public func billingGetGithubActionsBillingOrg( - path: Operations.BillingGetGithubActionsBillingOrg.Input.Path, - headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubActionsBillingOrg.Output { - try await billingGetGithubActionsBillingOrg(Operations.BillingGetGithubActionsBillingOrg.Input( + /// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`. + public func billingUpdateBudgetOrg( + path: Operations.BillingUpdateBudgetOrg.Input.Path, + headers: Operations.BillingUpdateBudgetOrg.Input.Headers = .init(), + body: Operations.BillingUpdateBudgetOrg.Input.Body + ) async throws -> Operations.BillingUpdateBudgetOrg.Output { + try await billingUpdateBudgetOrg(Operations.BillingUpdateBudgetOrg.Input( path: path, - headers: headers + headers: headers, + body: body )) } - /// Get GitHub Packages billing for an organization - /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// Delete a budget for an organization /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. - public func billingGetGithubPackagesBillingOrg( - path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubPackagesBillingOrg.Output { - try await billingGetGithubPackagesBillingOrg(Operations.BillingGetGithubPackagesBillingOrg.Input( + /// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`. + public func billingDeleteBudgetOrg( + path: Operations.BillingDeleteBudgetOrg.Input.Path, + headers: Operations.BillingDeleteBudgetOrg.Input.Headers = .init() + ) async throws -> Operations.BillingDeleteBudgetOrg.Output { + try await billingDeleteBudgetOrg(Operations.BillingDeleteBudgetOrg.Input( path: path, headers: headers )) } - /// Get shared storage billing for an organization - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Get billing premium request usage report for an organization /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. - public func billingGetSharedStorageBillingOrg( - path: Operations.BillingGetSharedStorageBillingOrg.Input.Path, - headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers = .init() - ) async throws -> Operations.BillingGetSharedStorageBillingOrg.Output { - try await billingGetSharedStorageBillingOrg(Operations.BillingGetSharedStorageBillingOrg.Input( + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public func billingGetGithubBillingPremiumRequestUsageReportOrg( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { + try await billingGetGithubBillingPremiumRequestUsageReportOrg(Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input( path: path, + query: query, headers: headers )) } - /// Get GitHub Actions billing for a user - /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// Get billing usage report for an organization /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. - public func billingGetGithubActionsBillingUser( - path: Operations.BillingGetGithubActionsBillingUser.Input.Path, - headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubActionsBillingUser.Output { - try await billingGetGithubActionsBillingUser(Operations.BillingGetGithubActionsBillingUser.Input( + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public func billingGetGithubBillingUsageReportOrg( + path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output { + try await billingGetGithubBillingUsageReportOrg(Operations.BillingGetGithubBillingUsageReportOrg.Input( path: path, + query: query, headers: headers )) } - /// Get GitHub Packages billing for a user + /// Get billing usage summary for an organization /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. - public func billingGetGithubPackagesBillingUser( - path: Operations.BillingGetGithubPackagesBillingUser.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers = .init() - ) async throws -> Operations.BillingGetGithubPackagesBillingUser.Output { - try await billingGetGithubPackagesBillingUser(Operations.BillingGetGithubPackagesBillingUser.Input( + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`. + public func billingGetGithubBillingUsageSummaryReportOrg( + path: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportOrg.Output { + try await billingGetGithubBillingUsageSummaryReportOrg(Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input( path: path, + query: query, headers: headers )) } @@ -269,25 +272,6 @@ extension APIProtocol { headers: headers )) } - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - public func billingGetSharedStorageBillingUser( - path: Operations.BillingGetSharedStorageBillingUser.Input.Path, - headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers = .init() - ) async throws -> Operations.BillingGetSharedStorageBillingUser.Output { - try await billingGetSharedStorageBillingUser(Operations.BillingGetSharedStorageBillingUser.Input( - path: path, - headers: headers - )) - } /// Get billing usage report for a user /// /// Gets a report of the total usage for a user. @@ -307,6 +291,28 @@ extension APIProtocol { headers: headers )) } + /// Get billing usage summary for a user + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets a summary report of usage for a user. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`. + public func billingGetGithubBillingUsageSummaryReportUser( + path: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Path, + query: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportUser.Output { + try await billingGetGithubBillingUsageSummaryReportUser(Operations.BillingGetGithubBillingUsageSummaryReportUser.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -418,6 +424,492 @@ public enum Components { case schemas } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/components/schemas/budget`. + public struct Budget: Codable, Hashable, Sendable { + /// The unique identifier for the budget + /// + /// - Remark: Generated from `#/components/schemas/budget/id`. + public var id: Swift.String + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_type`. + @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/budget/budget_type/case1`. + @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/components/schemas/budget/budget_type/case1`. + case case1(Components.Schemas.Budget.BudgetTypePayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/budget/budget_type/case2`. + @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { + case productPricing = "ProductPricing" + } + /// - Remark: Generated from `#/components/schemas/budget/budget_type/case2`. + case case2(Components.Schemas.Budget.BudgetTypePayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_type`. + public var budgetType: Components.Schemas.Budget.BudgetTypePayload + /// The budget amount limit in whole dollars. For license-based products, this represents the number of licenses. + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_amount`. + public var budgetAmount: Swift.Int + /// The type of limit enforcement for the budget + /// + /// - Remark: Generated from `#/components/schemas/budget/prevent_further_usage`. + public var preventFurtherUsage: Swift.Bool + /// The scope of the budget (enterprise, organization, repository, cost center) + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_scope`. + public var budgetScope: Swift.String + /// The name of the entity for the budget (enterprise does not require a name). + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_entity_name`. + public var budgetEntityName: Swift.String? + /// A single product or sku to apply the budget to. + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_product_sku`. + public var budgetProductSku: Swift.String + /// - Remark: Generated from `#/components/schemas/budget/budget_alerting`. + public struct BudgetAlertingPayload: Codable, Hashable, Sendable { + /// Whether alerts are enabled for this budget + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_alerting/will_alert`. + public var willAlert: Swift.Bool + /// Array of user login names who will receive alerts + /// + /// - Remark: Generated from `#/components/schemas/budget/budget_alerting/alert_recipients`. + public var alertRecipients: [Swift.String] + /// Creates a new `BudgetAlertingPayload`. + /// + /// - Parameters: + /// - willAlert: Whether alerts are enabled for this budget + /// - alertRecipients: Array of user login names who will receive alerts + public init( + willAlert: Swift.Bool, + alertRecipients: [Swift.String] + ) { + self.willAlert = willAlert + self.alertRecipients = alertRecipients + } + public enum CodingKeys: String, CodingKey { + case willAlert = "will_alert" + case alertRecipients = "alert_recipients" + } + } + /// - Remark: Generated from `#/components/schemas/budget/budget_alerting`. + public var budgetAlerting: Components.Schemas.Budget.BudgetAlertingPayload + /// Creates a new `Budget`. + /// + /// - Parameters: + /// - id: The unique identifier for the budget + /// - budgetType: The type of pricing for the budget + /// - budgetAmount: The budget amount limit in whole dollars. For license-based products, this represents the number of licenses. + /// - preventFurtherUsage: The type of limit enforcement for the budget + /// - budgetScope: The scope of the budget (enterprise, organization, repository, cost center) + /// - budgetEntityName: The name of the entity for the budget (enterprise does not require a name). + /// - budgetProductSku: A single product or sku to apply the budget to. + /// - budgetAlerting: + public init( + id: Swift.String, + budgetType: Components.Schemas.Budget.BudgetTypePayload, + budgetAmount: Swift.Int, + preventFurtherUsage: Swift.Bool, + budgetScope: Swift.String, + budgetEntityName: Swift.String? = nil, + budgetProductSku: Swift.String, + budgetAlerting: Components.Schemas.Budget.BudgetAlertingPayload + ) { + self.id = id + self.budgetType = budgetType + self.budgetAmount = budgetAmount + self.preventFurtherUsage = preventFurtherUsage + self.budgetScope = budgetScope + self.budgetEntityName = budgetEntityName + self.budgetProductSku = budgetProductSku + self.budgetAlerting = budgetAlerting + } + public enum CodingKeys: String, CodingKey { + case id + case budgetType = "budget_type" + case budgetAmount = "budget_amount" + case preventFurtherUsage = "prevent_further_usage" + case budgetScope = "budget_scope" + case budgetEntityName = "budget_entity_name" + case budgetProductSku = "budget_product_sku" + case budgetAlerting = "budget_alerting" + } + } + /// - Remark: Generated from `#/components/schemas/get_all_budgets`. + public struct GetAllBudgets: Codable, Hashable, Sendable { + /// Array of budget objects for the enterprise + /// + /// - Remark: Generated from `#/components/schemas/get_all_budgets/budgets`. + public var budgets: [Components.Schemas.Budget] + /// Indicates if there are more pages of results available (maps to hasNextPage from billing platform) + /// + /// - Remark: Generated from `#/components/schemas/get_all_budgets/has_next_page`. + public var hasNextPage: Swift.Bool? + /// Total number of budgets matching the query + /// + /// - Remark: Generated from `#/components/schemas/get_all_budgets/total_count`. + public var totalCount: Swift.Int? + /// Creates a new `GetAllBudgets`. + /// + /// - Parameters: + /// - budgets: Array of budget objects for the enterprise + /// - hasNextPage: Indicates if there are more pages of results available (maps to hasNextPage from billing platform) + /// - totalCount: Total number of budgets matching the query + public init( + budgets: [Components.Schemas.Budget], + hasNextPage: Swift.Bool? = nil, + totalCount: Swift.Int? = nil + ) { + self.budgets = budgets + self.hasNextPage = hasNextPage + self.totalCount = totalCount + } + public enum CodingKeys: String, CodingKey { + case budgets + case hasNextPage = "has_next_page" + case totalCount = "total_count" + } + } + /// - Remark: Generated from `#/components/schemas/get-budget`. + public struct GetBudget: Codable, Hashable, Sendable { + /// ID of the budget. + /// + /// - Remark: Generated from `#/components/schemas/get-budget/id`. + public var id: Swift.String + /// The type of scope for the budget + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_scope`. + @frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + case repository = "repository" + case costCenter = "cost_center" + } + /// The type of scope for the budget + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_scope`. + public var budgetScope: Components.Schemas.GetBudget.BudgetScopePayload + /// The name of the entity to apply the budget to + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_entity_name`. + public var budgetEntityName: Swift.String + /// The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_amount`. + public var budgetAmount: Swift.Int + /// Whether to prevent additional spending once the budget is exceeded + /// + /// - Remark: Generated from `#/components/schemas/get-budget/prevent_further_usage`. + public var preventFurtherUsage: Swift.Bool + /// A single product or sku to apply the budget to. + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_product_sku`. + public var budgetProductSku: Swift.String + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type`. + @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case1`. + @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { + case productPricing = "ProductPricing" + } + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case1`. + case case1(Components.Schemas.GetBudget.BudgetTypePayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case2`. + @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case2`. + case case2(Components.Schemas.GetBudget.BudgetTypePayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_type`. + public var budgetType: Components.Schemas.GetBudget.BudgetTypePayload + /// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting`. + public struct BudgetAlertingPayload: Codable, Hashable, Sendable { + /// Whether alerts are enabled for this budget + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting/will_alert`. + public var willAlert: Swift.Bool? + /// Array of user login names who will receive alerts + /// + /// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting/alert_recipients`. + public var alertRecipients: [Swift.String]? + /// Creates a new `BudgetAlertingPayload`. + /// + /// - Parameters: + /// - willAlert: Whether alerts are enabled for this budget + /// - alertRecipients: Array of user login names who will receive alerts + public init( + willAlert: Swift.Bool? = nil, + alertRecipients: [Swift.String]? = nil + ) { + self.willAlert = willAlert + self.alertRecipients = alertRecipients + } + public enum CodingKeys: String, CodingKey { + case willAlert = "will_alert" + case alertRecipients = "alert_recipients" + } + } + /// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting`. + public var budgetAlerting: Components.Schemas.GetBudget.BudgetAlertingPayload + /// Creates a new `GetBudget`. + /// + /// - Parameters: + /// - id: ID of the budget. + /// - budgetScope: The type of scope for the budget + /// - budgetEntityName: The name of the entity to apply the budget to + /// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded + /// - budgetProductSku: A single product or sku to apply the budget to. + /// - budgetType: The type of pricing for the budget + /// - budgetAlerting: + public init( + id: Swift.String, + budgetScope: Components.Schemas.GetBudget.BudgetScopePayload, + budgetEntityName: Swift.String, + budgetAmount: Swift.Int, + preventFurtherUsage: Swift.Bool, + budgetProductSku: Swift.String, + budgetType: Components.Schemas.GetBudget.BudgetTypePayload, + budgetAlerting: Components.Schemas.GetBudget.BudgetAlertingPayload + ) { + self.id = id + self.budgetScope = budgetScope + self.budgetEntityName = budgetEntityName + self.budgetAmount = budgetAmount + self.preventFurtherUsage = preventFurtherUsage + self.budgetProductSku = budgetProductSku + self.budgetType = budgetType + self.budgetAlerting = budgetAlerting + } + public enum CodingKeys: String, CodingKey { + case id + case budgetScope = "budget_scope" + case budgetEntityName = "budget_entity_name" + case budgetAmount = "budget_amount" + case preventFurtherUsage = "prevent_further_usage" + case budgetProductSku = "budget_product_sku" + case budgetType = "budget_type" + case budgetAlerting = "budget_alerting" + } + } + /// - Remark: Generated from `#/components/schemas/delete-budget`. + public struct DeleteBudget: Codable, Hashable, Sendable { + /// A message indicating the result of the deletion operation + /// + /// - Remark: Generated from `#/components/schemas/delete-budget/message`. + public var message: Swift.String + /// The ID of the deleted budget + /// + /// - Remark: Generated from `#/components/schemas/delete-budget/id`. + public var id: Swift.String + /// Creates a new `DeleteBudget`. + /// + /// - Parameters: + /// - message: A message indicating the result of the deletion operation + /// - id: The ID of the deleted budget + public init( + message: Swift.String, + id: Swift.String + ) { + self.message = message + self.id = id + } + public enum CodingKeys: String, CodingKey { + case message + case id + } + } /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org`. public struct BillingPremiumRequestUsageReportOrg: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`. @@ -725,246 +1217,187 @@ public enum Components { case usageItems } } - /// - Remark: Generated from `#/components/schemas/actions-billing-usage`. - public struct ActionsBillingUsage: Codable, Hashable, Sendable { - /// The sum of the free and paid GitHub Actions minutes used. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/total_minutes_used`. - public var totalMinutesUsed: Swift.Int - /// The total paid GitHub Actions minutes used. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/total_paid_minutes_used`. - public var totalPaidMinutesUsed: Swift.Int - /// The amount of free GitHub Actions minutes available. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/included_minutes`. - public var includedMinutes: Swift.Int - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown`. - public struct MinutesUsedBreakdownPayload: Codable, Hashable, Sendable { - /// Total minutes used on Ubuntu runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/UBUNTU`. - public var ubuntu: Swift.Int? - /// Total minutes used on macOS runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/MACOS`. - public var macos: Swift.Int? - /// Total minutes used on Windows runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/WINDOWS`. - public var windows: Swift.Int? - /// Total minutes used on Ubuntu 4 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/ubuntu_4_core`. - public var ubuntu4Core: Swift.Int? - /// Total minutes used on Ubuntu 8 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/ubuntu_8_core`. - public var ubuntu8Core: Swift.Int? - /// Total minutes used on Ubuntu 16 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/ubuntu_16_core`. - public var ubuntu16Core: Swift.Int? - /// Total minutes used on Ubuntu 32 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/ubuntu_32_core`. - public var ubuntu32Core: Swift.Int? - /// Total minutes used on Ubuntu 64 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/ubuntu_64_core`. - public var ubuntu64Core: Swift.Int? - /// Total minutes used on Windows 4 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/windows_4_core`. - public var windows4Core: Swift.Int? - /// Total minutes used on Windows 8 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/windows_8_core`. - public var windows8Core: Swift.Int? - /// Total minutes used on Windows 16 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/windows_16_core`. - public var windows16Core: Swift.Int? - /// Total minutes used on Windows 32 core runner machines. - /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/windows_32_core`. - public var windows32Core: Swift.Int? - /// Total minutes used on Windows 64 core runner machines. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org`. + public struct BillingUsageSummaryReportOrg: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/windows_64_core`. - public var windows64Core: Swift.Int? - /// Total minutes used on macOS 12 core runner machines. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/macos_12_core`. - public var macos12Core: Swift.Int? - /// Total minutes used on all runner machines. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. /// - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown/total`. - public var total: Swift.Int? - /// Creates a new `MinutesUsedBreakdownPayload`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. /// /// - Parameters: - /// - ubuntu: Total minutes used on Ubuntu runner machines. - /// - macos: Total minutes used on macOS runner machines. - /// - windows: Total minutes used on Windows runner machines. - /// - ubuntu4Core: Total minutes used on Ubuntu 4 core runner machines. - /// - ubuntu8Core: Total minutes used on Ubuntu 8 core runner machines. - /// - ubuntu16Core: Total minutes used on Ubuntu 16 core runner machines. - /// - ubuntu32Core: Total minutes used on Ubuntu 32 core runner machines. - /// - ubuntu64Core: Total minutes used on Ubuntu 64 core runner machines. - /// - windows4Core: Total minutes used on Windows 4 core runner machines. - /// - windows8Core: Total minutes used on Windows 8 core runner machines. - /// - windows16Core: Total minutes used on Windows 16 core runner machines. - /// - windows32Core: Total minutes used on Windows 32 core runner machines. - /// - windows64Core: Total minutes used on Windows 64 core runner machines. - /// - macos12Core: Total minutes used on macOS 12 core runner machines. - /// - total: Total minutes used on all runner machines. + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. public init( - ubuntu: Swift.Int? = nil, - macos: Swift.Int? = nil, - windows: Swift.Int? = nil, - ubuntu4Core: Swift.Int? = nil, - ubuntu8Core: Swift.Int? = nil, - ubuntu16Core: Swift.Int? = nil, - ubuntu32Core: Swift.Int? = nil, - ubuntu64Core: Swift.Int? = nil, - windows4Core: Swift.Int? = nil, - windows8Core: Swift.Int? = nil, - windows16Core: Swift.Int? = nil, - windows32Core: Swift.Int? = nil, - windows64Core: Swift.Int? = nil, - macos12Core: Swift.Int? = nil, - total: Swift.Int? = nil + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil ) { - self.ubuntu = ubuntu - self.macos = macos - self.windows = windows - self.ubuntu4Core = ubuntu4Core - self.ubuntu8Core = ubuntu8Core - self.ubuntu16Core = ubuntu16Core - self.ubuntu32Core = ubuntu32Core - self.ubuntu64Core = ubuntu64Core - self.windows4Core = windows4Core - self.windows8Core = windows8Core - self.windows16Core = windows16Core - self.windows32Core = windows32Core - self.windows64Core = windows64Core - self.macos12Core = macos12Core - self.total = total - } + self.year = year + self.month = month + self.day = day + } public enum CodingKeys: String, CodingKey { - case ubuntu = "UBUNTU" - case macos = "MACOS" - case windows = "WINDOWS" - case ubuntu4Core = "ubuntu_4_core" - case ubuntu8Core = "ubuntu_8_core" - case ubuntu16Core = "ubuntu_16_core" - case ubuntu32Core = "ubuntu_32_core" - case ubuntu64Core = "ubuntu_64_core" - case windows4Core = "windows_4_core" - case windows8Core = "windows_8_core" - case windows16Core = "windows_16_core" - case windows32Core = "windows_32_core" - case windows64Core = "windows_64_core" - case macos12Core = "macos_12_core" - case total - } - } - /// - Remark: Generated from `#/components/schemas/actions-billing-usage/minutes_used_breakdown`. - public var minutesUsedBreakdown: Components.Schemas.ActionsBillingUsage.MinutesUsedBreakdownPayload - /// Creates a new `ActionsBillingUsage`. - /// - /// - Parameters: - /// - totalMinutesUsed: The sum of the free and paid GitHub Actions minutes used. - /// - totalPaidMinutesUsed: The total paid GitHub Actions minutes used. - /// - includedMinutes: The amount of free GitHub Actions minutes available. - /// - minutesUsedBreakdown: - public init( - totalMinutesUsed: Swift.Int, - totalPaidMinutesUsed: Swift.Int, - includedMinutes: Swift.Int, - minutesUsedBreakdown: Components.Schemas.ActionsBillingUsage.MinutesUsedBreakdownPayload - ) { - self.totalMinutesUsed = totalMinutesUsed - self.totalPaidMinutesUsed = totalPaidMinutesUsed - self.includedMinutes = includedMinutes - self.minutesUsedBreakdown = minutesUsedBreakdown - } - public enum CodingKeys: String, CodingKey { - case totalMinutesUsed = "total_minutes_used" - case totalPaidMinutesUsed = "total_paid_minutes_used" - case includedMinutes = "included_minutes" - case minutesUsedBreakdown = "minutes_used_breakdown" + case year + case month + case day + } } - } - /// - Remark: Generated from `#/components/schemas/packages-billing-usage`. - public struct PackagesBillingUsage: Codable, Hashable, Sendable { - /// Sum of the free and paid storage space (GB) for GitHuub Packages. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/timePeriod`. + public var timePeriod: Components.Schemas.BillingUsageSummaryReportOrg.TimePeriodPayload + /// The unique identifier of the organization. /// - /// - Remark: Generated from `#/components/schemas/packages-billing-usage/total_gigabytes_bandwidth_used`. - public var totalGigabytesBandwidthUsed: Swift.Int - /// Total paid storage space (GB) for GitHuub Packages. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/organization`. + public var organization: Swift.String + /// The name of the repository for the usage report. /// - /// - Remark: Generated from `#/components/schemas/packages-billing-usage/total_paid_gigabytes_bandwidth_used`. - public var totalPaidGigabytesBandwidthUsed: Swift.Int - /// Free storage space (GB) for GitHub Packages. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/repository`. + public var repository: Swift.String? + /// The product for the usage report. /// - /// - Remark: Generated from `#/components/schemas/packages-billing-usage/included_gigabytes_bandwidth`. - public var includedGigabytesBandwidth: Swift.Int - /// Creates a new `PackagesBillingUsage`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/product`. + public var product: Swift.String? + /// The SKU for the usage report. /// - /// - Parameters: - /// - totalGigabytesBandwidthUsed: Sum of the free and paid storage space (GB) for GitHuub Packages. - /// - totalPaidGigabytesBandwidthUsed: Total paid storage space (GB) for GitHuub Packages. - /// - includedGigabytesBandwidth: Free storage space (GB) for GitHub Packages. - public init( - totalGigabytesBandwidthUsed: Swift.Int, - totalPaidGigabytesBandwidthUsed: Swift.Int, - includedGigabytesBandwidth: Swift.Int - ) { - self.totalGigabytesBandwidthUsed = totalGigabytesBandwidthUsed - self.totalPaidGigabytesBandwidthUsed = totalPaidGigabytesBandwidthUsed - self.includedGigabytesBandwidth = includedGigabytesBandwidth - } - public enum CodingKeys: String, CodingKey { - case totalGigabytesBandwidthUsed = "total_gigabytes_bandwidth_used" - case totalPaidGigabytesBandwidthUsed = "total_paid_gigabytes_bandwidth_used" - case includedGigabytesBandwidth = "included_gigabytes_bandwidth" + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/sku`. + public var sku: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Double, + grossAmount: Swift.Double, + discountQuantity: Swift.Double, + discountAmount: Swift.Double, + netQuantity: Swift.Double, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount + } } - } - /// - Remark: Generated from `#/components/schemas/combined-billing-usage`. - public struct CombinedBillingUsage: Codable, Hashable, Sendable { - /// Numbers of days left in billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/combined-billing-usage/days_left_in_billing_cycle`. - public var daysLeftInBillingCycle: Swift.Int - /// Estimated storage space (GB) used in billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/combined-billing-usage/estimated_paid_storage_for_month`. - public var estimatedPaidStorageForMonth: Swift.Int - /// Estimated sum of free and paid storage space (GB) used in billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/combined-billing-usage/estimated_storage_for_month`. - public var estimatedStorageForMonth: Swift.Int - /// Creates a new `CombinedBillingUsage`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingUsageSummaryReportOrg.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-org/usageItems`. + public var usageItems: Components.Schemas.BillingUsageSummaryReportOrg.UsageItemsPayload + /// Creates a new `BillingUsageSummaryReportOrg`. /// /// - Parameters: - /// - daysLeftInBillingCycle: Numbers of days left in billing cycle. - /// - estimatedPaidStorageForMonth: Estimated storage space (GB) used in billing cycle. - /// - estimatedStorageForMonth: Estimated sum of free and paid storage space (GB) used in billing cycle. + /// - timePeriod: + /// - organization: The unique identifier of the organization. + /// - repository: The name of the repository for the usage report. + /// - product: The product for the usage report. + /// - sku: The SKU for the usage report. + /// - usageItems: public init( - daysLeftInBillingCycle: Swift.Int, - estimatedPaidStorageForMonth: Swift.Int, - estimatedStorageForMonth: Swift.Int + timePeriod: Components.Schemas.BillingUsageSummaryReportOrg.TimePeriodPayload, + organization: Swift.String, + repository: Swift.String? = nil, + product: Swift.String? = nil, + sku: Swift.String? = nil, + usageItems: Components.Schemas.BillingUsageSummaryReportOrg.UsageItemsPayload ) { - self.daysLeftInBillingCycle = daysLeftInBillingCycle - self.estimatedPaidStorageForMonth = estimatedPaidStorageForMonth - self.estimatedStorageForMonth = estimatedStorageForMonth + self.timePeriod = timePeriod + self.organization = organization + self.repository = repository + self.product = product + self.sku = sku + self.usageItems = usageItems } public enum CodingKeys: String, CodingKey { - case daysLeftInBillingCycle = "days_left_in_billing_cycle" - case estimatedPaidStorageForMonth = "estimated_paid_storage_for_month" - case estimatedStorageForMonth = "estimated_storage_for_month" + case timePeriod + case organization + case repository + case product + case sku + case usageItems } } /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user`. @@ -1258,111 +1691,302 @@ public enum Components { case usageItems } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. - public typealias BillingUsageReportYear = Swift.Int - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-month-default`. - public typealias BillingUsageReportMonthDefault = Swift.Int - /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. - public typealias BillingUsageReportDay = Swift.Int - /// The user name to query usage for. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-user`. - public typealias BillingUsageReportUser = Swift.String - /// The model name to query usage for. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-model`. - public typealias BillingUsageReportModel = Swift.String - /// The product name to query usage for. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-product`. - public typealias BillingUsageReportProduct = Swift.String - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. - public typealias BillingUsageReportMonth = Swift.Int - /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. - public typealias BillingUsageReportHour = Swift.Int - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user`. + public struct BillingUsageSummaryReportUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. + /// + /// - Parameters: + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. + public init( + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil + ) { + self.year = year + self.month = month + self.day = day + } + public enum CodingKeys: String, CodingKey { + case year + case month + case day } } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/timePeriod`. + public var timePeriod: Components.Schemas.BillingUsageSummaryReportUser.TimePeriodPayload + /// The unique identifier of the user. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body - } - } - public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/user`. + public var user: Swift.String + /// The name of the repository for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/repository`. + public var repository: Swift.String? + /// The product for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/product`. + public var product: Swift.String? + /// The SKU for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/sku`. + public var sku: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. - case applicationScimJson(Components.Schemas.ScimError) - /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. /// - /// - Throws: An error if `self` is not `.applicationScimJson`. - /// - SeeAlso: `.applicationScimJson`. - public var applicationScimJson: Components.Schemas.ScimError { + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Double, + grossAmount: Swift.Double, + discountQuantity: Swift.Double, + discountAmount: Swift.Double, + netQuantity: Swift.Double, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount + } + } + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingUsageSummaryReportUser.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-usage-summary-report-user/usageItems`. + public var usageItems: Components.Schemas.BillingUsageSummaryReportUser.UsageItemsPayload + /// Creates a new `BillingUsageSummaryReportUser`. + /// + /// - Parameters: + /// - timePeriod: + /// - user: The unique identifier of the user. + /// - repository: The name of the repository for the usage report. + /// - product: The product for the usage report. + /// - sku: The SKU for the usage report. + /// - usageItems: + public init( + timePeriod: Components.Schemas.BillingUsageSummaryReportUser.TimePeriodPayload, + user: Swift.String, + repository: Swift.String? = nil, + product: Swift.String? = nil, + sku: Swift.String? = nil, + usageItems: Components.Schemas.BillingUsageSummaryReportUser.UsageItemsPayload + ) { + self.timePeriod = timePeriod + self.user = user + self.repository = repository + self.product = product + self.sku = sku + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case timePeriod + case user + case repository + case product + case sku + case usageItems + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The ID corresponding to the budget. + /// + /// - Remark: Generated from `#/components/parameters/budget`. + public typealias Budget = Swift.String + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. + public typealias BillingUsageReportYear = Swift.Int + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month-default`. + public typealias BillingUsageReportMonthDefault = Swift.Int + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. + public typealias BillingUsageReportDay = Swift.Int + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-user`. + public typealias BillingUsageReportUser = Swift.String + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-model`. + public typealias BillingUsageReportModel = Swift.String + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-product`. + public typealias BillingUsageReportProduct = Swift.String + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. + public typealias BillingUsageReportMonth = Swift.Int + /// The repository name to query for usage in the format owner/repository. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-repository`. + public typealias BillingUsageReportRepository = Swift.String + /// The SKU to query for usage. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-sku`. + public typealias BillingUsageReportSku = Swift.String + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { get throws { switch self { case let .applicationScimJson(body): @@ -1386,6 +2010,62 @@ public enum Components { self.body = body } } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -1499,16 +2179,16 @@ public enum Components { self.body = body } } - public struct BillingPremiumRequestUsageReportOrg: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content`. + public struct GetAllBudgets: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/get_all_budgets/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content/application\/json`. - case json(Components.Schemas.BillingPremiumRequestUsageReportOrg) + /// - Remark: Generated from `#/components/responses/get_all_budgets/content/application\/json`. + case json(Components.Schemas.GetAllBudgets) /// 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.BillingPremiumRequestUsageReportOrg { + public var json: Components.Schemas.GetAllBudgets { get throws { switch self { case let .json(body): @@ -1518,25 +2198,25 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body - /// Creates a new `BillingPremiumRequestUsageReportOrg`. + public var body: Components.Responses.GetAllBudgets.Body + /// Creates a new `GetAllBudgets`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body) { + public init(body: Components.Responses.GetAllBudgets.Body) { self.body = body } } - public struct BillingUsageReportOrg: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. + public struct Budget: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/budget/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content/application\/json`. - case json(Components.Schemas.BillingUsageReport) + /// - Remark: Generated from `#/components/responses/budget/content/application\/json`. + case json(Components.Schemas.GetBudget) /// 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.BillingUsageReport { + public var json: Components.Schemas.GetBudget { get throws { switch self { case let .json(body): @@ -1546,7 +2226,91 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.BillingUsageReportOrg.Body + public var body: Components.Responses.Budget.Body + /// Creates a new `Budget`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Budget.Body) { + self.body = body + } + } + public struct DeleteBudget: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/delete-budget/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/delete-budget/content/application\/json`. + case json(Components.Schemas.DeleteBudget) + /// 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.DeleteBudget { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.DeleteBudget.Body + /// Creates a new `DeleteBudget`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.DeleteBudget.Body) { + self.body = body + } + } + public struct BillingPremiumRequestUsageReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content/application\/json`. + case json(Components.Schemas.BillingPremiumRequestUsageReportOrg) + /// 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.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body + /// Creates a new `BillingPremiumRequestUsageReportOrg`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body) { + self.body = body + } + } + public struct BillingUsageReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content/application\/json`. + case json(Components.Schemas.BillingUsageReport) + /// 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.BillingUsageReport { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageReportOrg.Body /// Creates a new `BillingUsageReportOrg`. /// /// - Parameters: @@ -1555,6 +2319,34 @@ public enum Components { self.body = body } } + public struct BillingUsageSummaryReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_summary_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_summary_report_org/content/application\/json`. + case json(Components.Schemas.BillingUsageSummaryReportOrg) + /// 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.BillingUsageSummaryReportOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageSummaryReportOrg.Body + /// Creates a new `BillingUsageSummaryReportOrg`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingUsageSummaryReportOrg.Body) { + self.body = body + } + } public struct BillingPremiumRequestUsageReportUser: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_user/content`. @frozen public enum Body: Sendable, Hashable { @@ -1611,6 +2403,34 @@ public enum Components { self.body = body } } + public struct BillingUsageSummaryReportUser: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_summary_report_user/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_summary_report_user/content/application\/json`. + case json(Components.Schemas.BillingUsageSummaryReportUser) + /// 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.BillingUsageSummaryReportUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageSummaryReportUser.Body + /// Creates a new `BillingUsageSummaryReportUser`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingUsageSummaryReportUser.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} @@ -1618,22 +2438,24 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get billing premium request usage report for an organization + /// Get all budgets for an organization /// - /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager. + /// Each page returns up to 10 budgets. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. - public enum BillingGetGithubBillingPremiumRequestUsageReportOrg { - public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-org" + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`. + public enum BillingGetAllBudgetsOrg { + public static let id: Swift.String = "billing/get-all-budgets-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -1643,71 +2465,57 @@ public enum Operations { self.org = org } } - public var path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query`. + public var path: Operations.BillingGetAllBudgetsOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query`. public struct Query: Sendable, Hashable { - /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/year`. - public var year: Components.Parameters.BillingUsageReportYear? - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/month`. - public var month: Components.Parameters.BillingUsageReportMonthDefault? - /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/day`. - public var day: Components.Parameters.BillingUsageReportDay? - /// The user name to query usage for. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/user`. - public var user: Components.Parameters.BillingUsageReportUser? - /// The model name to query usage for. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/model`. - public var model: Components.Parameters.BillingUsageReportModel? - /// The product name to query usage for. The name is not case sensitive. + /// The page number of the results to fetch. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query/page`. + public var page: Swift.Int? + /// The number of results per page (max 10). + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query/per_page`. + public var perPage: Swift.Int? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query/scope`. + @frozen public enum ScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + case repository = "repository" + case costCenter = "cost_center" + } + /// Filter budgets by scope type. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/product`. - public var product: Components.Parameters.BillingUsageReportProduct? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query/scope`. + public var scope: Operations.BillingGetAllBudgetsOrg.Input.Query.ScopePayload? /// Creates a new `Query`. /// /// - Parameters: - /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. - /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - user: The user name to query usage for. The name is not case sensitive. - /// - model: The model name to query usage for. The name is not case sensitive. - /// - product: The product name to query usage for. The name is not case sensitive. + /// - page: The page number of the results to fetch. + /// - perPage: The number of results per page (max 10). + /// - scope: Filter budgets by scope type. public init( - year: Components.Parameters.BillingUsageReportYear? = nil, - month: Components.Parameters.BillingUsageReportMonthDefault? = nil, - day: Components.Parameters.BillingUsageReportDay? = nil, - user: Components.Parameters.BillingUsageReportUser? = nil, - model: Components.Parameters.BillingUsageReportModel? = nil, - product: Components.Parameters.BillingUsageReportProduct? = nil + page: Swift.Int? = nil, + perPage: Swift.Int? = nil, + scope: Operations.BillingGetAllBudgetsOrg.Input.Query.ScopePayload? = nil ) { - self.year = year - self.month = month - self.day = day - self.user = user - self.model = model - self.product = product + self.page = page + self.perPage = perPage + self.scope = scope } } - public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/header`. + public var query: Operations.BillingGetAllBudgetsOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/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.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers + public var headers: Operations.BillingGetAllBudgetsOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -1715,9 +2523,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, - query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + path: Operations.BillingGetAllBudgetsOrg.Input.Path, + query: Operations.BillingGetAllBudgetsOrg.Input.Query = .init(), + headers: Operations.BillingGetAllBudgetsOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -1725,17 +2533,17 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - /// Response when getting a billing premium request usage report + /// Response when getting all budgets /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.BillingPremiumRequestUsageReportOrg) + case ok(Components.Responses.GetAllBudgets) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.BillingPremiumRequestUsageReportOrg { + public var ok: Components.Responses.GetAllBudgets { get throws { switch self { case let .ok(response): @@ -1748,24 +2556,24 @@ public enum Operations { } } } - /// Bad Request + /// Resource not found /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/400`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)/responses/404`. /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. + /// 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 `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .badRequest(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", + expectedStatus: "notFound", response: self ) } @@ -1773,7 +2581,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/403`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -1794,32 +2602,9 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Internal Error /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/500`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -1840,29 +2625,6 @@ public enum Operations { } } } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -1870,14 +2632,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -1888,122 +2647,88 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Get billing usage report for an organization + /// Get a budget by ID for an organization /// - /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// Gets a budget by ID. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. - public enum BillingGetGithubBillingUsageReportOrg { - public static let id: Swift.String = "billing/get-github-billing-usage-report-org" + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`. + public enum BillingGetBudgetOrg { + public static let id: Swift.String = "billing/get-budget-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/GET/path/org`. public var org: Components.Parameters.Org + /// The ID corresponding to the budget. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/GET/path/budget_id`. + public var budgetId: Components.Parameters.Budget /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query`. - public struct Query: Sendable, Hashable { - /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/year`. - public var year: Components.Parameters.BillingUsageReportYear? - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/month`. - public var month: Components.Parameters.BillingUsageReportMonth? - /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/day`. - public var day: Components.Parameters.BillingUsageReportDay? - /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. - /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/hour`. - public var hour: Components.Parameters.BillingUsageReportHour? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. - /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// - budgetId: The ID corresponding to the budget. public init( - year: Components.Parameters.BillingUsageReportYear? = nil, - month: Components.Parameters.BillingUsageReportMonth? = nil, - day: Components.Parameters.BillingUsageReportDay? = nil, - hour: Components.Parameters.BillingUsageReportHour? = nil + org: Components.Parameters.Org, + budgetId: Components.Parameters.Budget ) { - self.year = year - self.month = month - self.day = day - self.hour = hour + self.org = org + self.budgetId = budgetId } } - public var query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/header`. + public var path: Operations.BillingGetBudgetOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_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.BillingGetGithubBillingUsageReportOrg.Input.Headers + public var headers: Operations.BillingGetBudgetOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, - query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() + path: Operations.BillingGetBudgetOrg.Input.Path, + headers: Operations.BillingGetBudgetOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Billing usage report response for an organization + /// Response when updating a budget /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.BillingUsageReportOrg) + case ok(Components.Responses.Budget) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.BillingUsageReportOrg { + public var ok: Components.Responses.Budget { get throws { switch self { case let .ok(response): @@ -2018,7 +2743,7 @@ public enum Operations { } /// Bad Request /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/400`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/400`. /// /// HTTP response code: `400 badRequest`. case badRequest(Components.Responses.BadRequest) @@ -2039,9 +2764,32 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Forbidden /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/403`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -2064,7 +2812,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/500`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -2087,7 +2835,7 @@ public enum Operations { } /// Service unavailable /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/503`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. case serviceUnavailable(Components.Responses.ServiceUnavailable) @@ -2145,70 +2893,410 @@ public enum Operations { } } } - /// Get GitHub Actions billing for an organization - /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// Update a budget for an organization /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. - public enum BillingGetGithubActionsBillingOrg { - public static let id: Swift.String = "billing/get-github-actions-billing-org" + /// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`. + public enum BillingUpdateBudgetOrg { + public static let id: Swift.String = "billing/update-budget-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/path/org`. public var org: Components.Parameters.Org + /// The ID corresponding to the budget. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/path/budget_id`. + public var budgetId: Components.Parameters.Budget /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - budgetId: The ID corresponding to the budget. + public init( + org: Components.Parameters.Org, + budgetId: Components.Parameters.Budget + ) { self.org = org + self.budgetId = budgetId } } - public var path: Operations.BillingGetGithubActionsBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/header`. + public var path: Operations.BillingUpdateBudgetOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_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.BillingGetGithubActionsBillingOrg.Input.Headers + public var headers: Operations.BillingUpdateBudgetOrg.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_amount`. + public var budgetAmount: Swift.Int? + /// Whether to prevent additional spending once the budget is exceeded + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/prevent_further_usage`. + public var preventFurtherUsage: Swift.Bool? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_alerting`. + public struct BudgetAlertingPayload: Codable, Hashable, Sendable { + /// Whether alerts are enabled for this budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_alerting/will_alert`. + public var willAlert: Swift.Bool? + /// Array of user login names who will receive alerts + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_alerting/alert_recipients`. + public var alertRecipients: [Swift.String]? + /// Creates a new `BudgetAlertingPayload`. + /// + /// - Parameters: + /// - willAlert: Whether alerts are enabled for this budget + /// - alertRecipients: Array of user login names who will receive alerts + public init( + willAlert: Swift.Bool? = nil, + alertRecipients: [Swift.String]? = nil + ) { + self.willAlert = willAlert + self.alertRecipients = alertRecipients + } + public enum CodingKeys: String, CodingKey { + case willAlert = "will_alert" + case alertRecipients = "alert_recipients" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_alerting`. + public var budgetAlerting: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetAlertingPayload? + /// The scope of the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_scope`. + @frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + case repository = "repository" + case costCenter = "cost_center" + } + /// The scope of the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_scope`. + public var budgetScope: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetScopePayload? + /// The name of the entity to apply the budget to + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_entity_name`. + public var budgetEntityName: Swift.String? + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type`. + @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case1`. + @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { + case productPricing = "ProductPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case1`. + case case1(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload.Case1Payload) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case2`. + @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case2`. + case case2(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type`. + public var budgetType: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload? + /// A single product or SKU that will be covered in the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_product_sku`. + public var budgetProductSku: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded + /// - budgetAlerting: + /// - budgetScope: The scope of the budget + /// - budgetEntityName: The name of the entity to apply the budget to + /// - budgetType: The type of pricing for the budget + /// - budgetProductSku: A single product or SKU that will be covered in the budget + public init( + budgetAmount: Swift.Int? = nil, + preventFurtherUsage: Swift.Bool? = nil, + budgetAlerting: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetAlertingPayload? = nil, + budgetScope: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetScopePayload? = nil, + budgetEntityName: Swift.String? = nil, + budgetType: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload? = nil, + budgetProductSku: Swift.String? = nil + ) { + self.budgetAmount = budgetAmount + self.preventFurtherUsage = preventFurtherUsage + self.budgetAlerting = budgetAlerting + self.budgetScope = budgetScope + self.budgetEntityName = budgetEntityName + self.budgetType = budgetType + self.budgetProductSku = budgetProductSku + } + public enum CodingKeys: String, CodingKey { + case budgetAmount = "budget_amount" + case preventFurtherUsage = "prevent_further_usage" + case budgetAlerting = "budget_alerting" + case budgetScope = "budget_scope" + case budgetEntityName = "budget_entity_name" + case budgetType = "budget_type" + case budgetProductSku = "budget_product_sku" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload) + } + public var body: Operations.BillingUpdateBudgetOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.BillingGetGithubActionsBillingOrg.Input.Path, - headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers = .init() + path: Operations.BillingUpdateBudgetOrg.Input.Path, + headers: Operations.BillingUpdateBudgetOrg.Input.Headers = .init(), + body: Operations.BillingUpdateBudgetOrg.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsBillingUsage) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget`. + public struct BudgetPayload: Codable, Hashable, Sendable { + /// ID of the budget. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/id`. + public var id: Swift.String? + /// The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_amount`. + public var budgetAmount: Swift.Float? + /// Whether to prevent additional spending once the budget is exceeded + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/prevent_further_usage`. + public var preventFurtherUsage: Swift.Bool? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_alerting`. + public struct BudgetAlertingPayload: Codable, Hashable, Sendable { + /// Whether alerts are enabled for this budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_alerting/will_alert`. + public var willAlert: Swift.Bool + /// Array of user login names who will receive alerts + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_alerting/alert_recipients`. + public var alertRecipients: [Swift.String] + /// Creates a new `BudgetAlertingPayload`. + /// + /// - Parameters: + /// - willAlert: Whether alerts are enabled for this budget + /// - alertRecipients: Array of user login names who will receive alerts + public init( + willAlert: Swift.Bool, + alertRecipients: [Swift.String] + ) { + self.willAlert = willAlert + self.alertRecipients = alertRecipients + } + public enum CodingKeys: String, CodingKey { + case willAlert = "will_alert" + case alertRecipients = "alert_recipients" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_alerting`. + public var budgetAlerting: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetAlertingPayload? + /// The scope of the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_scope`. + @frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + case repository = "repository" + case costCenter = "cost_center" + } + /// The scope of the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_scope`. + public var budgetScope: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetScopePayload? + /// The name of the entity to apply the budget to + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_entity_name`. + public var budgetEntityName: Swift.String? + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type`. + @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type/case1`. + @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { + case productPricing = "ProductPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type/case1`. + case case1(Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetTypePayload.Case1Payload) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type/case2`. + @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type/case2`. + case case2(Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetTypePayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The type of pricing for the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_type`. + public var budgetType: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetTypePayload? + /// A single product or SKU that will be covered in the budget + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget/budget_product_sku`. + public var budgetProductSku: Swift.String? + /// Creates a new `BudgetPayload`. + /// + /// - Parameters: + /// - id: ID of the budget. + /// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses. + /// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded + /// - budgetAlerting: + /// - budgetScope: The scope of the budget + /// - budgetEntityName: The name of the entity to apply the budget to + /// - budgetType: The type of pricing for the budget + /// - budgetProductSku: A single product or SKU that will be covered in the budget + public init( + id: Swift.String? = nil, + budgetAmount: Swift.Float? = nil, + preventFurtherUsage: Swift.Bool? = nil, + budgetAlerting: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetAlertingPayload? = nil, + budgetScope: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetScopePayload? = nil, + budgetEntityName: Swift.String? = nil, + budgetType: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload.BudgetTypePayload? = nil, + budgetProductSku: Swift.String? = nil + ) { + self.id = id + self.budgetAmount = budgetAmount + self.preventFurtherUsage = preventFurtherUsage + self.budgetAlerting = budgetAlerting + self.budgetScope = budgetScope + self.budgetEntityName = budgetEntityName + self.budgetType = budgetType + self.budgetProductSku = budgetProductSku + } + public enum CodingKeys: String, CodingKey { + case id + case budgetAmount = "budget_amount" + case preventFurtherUsage = "prevent_further_usage" + case budgetAlerting = "budget_alerting" + case budgetScope = "budget_scope" + case budgetEntityName = "budget_entity_name" + case budgetType = "budget_type" + case budgetProductSku = "budget_product_sku" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/json/budget`. + public var budget: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - budget: + public init( + message: Swift.String? = nil, + budget: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload.BudgetPayload? = nil + ) { + self.message = message + self.budget = budget + } + public enum CodingKeys: String, CodingKey { + case message + case budget + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/200/content/application\/json`. + case json(Operations.BillingUpdateBudgetOrg.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.ActionsBillingUsage { + public var json: Operations.BillingUpdateBudgetOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -2218,26 +3306,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body + public var body: Operations.BillingUpdateBudgetOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingUpdateBudgetOrg.Output.Ok.Body) { self.body = body } } - /// Response + /// Budget updated successfully /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubActionsBillingOrg.Output.Ok) + case ok(Operations.BillingUpdateBudgetOrg.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.BillingGetGithubActionsBillingOrg.Output.Ok { + public var ok: Operations.BillingUpdateBudgetOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -2250,101 +3338,85 @@ public enum Operations { } } } - /// Undocumented response. + /// Bad Request /// - /// 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 Packages billing for an organization - /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. - public enum BillingGetGithubPackagesBillingOrg { - public static let id: Swift.String = "billing/get-github-packages-billing-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/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//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } } } - public var path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/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 + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } } } - public var headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers - /// Creates a new `Input`. + /// Forbidden /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content`. + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content/application\/json`. - case json(Components.Schemas.PackagesBillingUsage) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/404/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.PackagesBillingUsage { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -2354,133 +3426,71 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.BillingUpdateBudgetOrg.Output.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingUpdateBudgetOrg.Output.NotFound.Body) { self.body = body } } - /// Response + /// Budget not found or feature not enabled /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubPackagesBillingOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Operations.BillingUpdateBudgetOrg.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.BillingUpdateBudgetOrg.Output.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } } } - /// Undocumented response. + /// Validation failed, or the endpoint has been spammed. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @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 shared storage billing for an organization - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. - /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. - public enum BillingGetSharedStorageBillingOrg { - public static let id: Swift.String = "billing/get-shared-storage-billing-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.BillingGetSharedStorageBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers - /// Creates a new `Input`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/422`. /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.BillingGetSharedStorageBillingOrg.Input.Path, - headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers + /// 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 + ) + } + } } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content`. + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CombinedBillingUsage) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/responses/500/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.CombinedBillingUsage { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -2490,33 +3500,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.BillingUpdateBudgetOrg.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingUpdateBudgetOrg.Output.InternalServerError.Body) { self.body = body } } - /// Response + /// Internal server error /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)/responses/500`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetSharedStorageBillingOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.BillingUpdateBudgetOrg.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetSharedStorageBillingOrg.Output.Ok { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.BillingUpdateBudgetOrg.Output.InternalServerError { get throws { switch self { - case let .ok(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "internalServerError", response: self ) } @@ -2529,11 +3539,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -2544,108 +3557,91 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get GitHub Actions billing for a user + /// Delete a budget for an organization /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. - public enum BillingGetGithubActionsBillingUser { - public static let id: Swift.String = "billing/get-github-actions-billing-user" + /// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`. + public enum BillingDeleteBudgetOrg { + public static let id: Swift.String = "billing/delete-budget-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The handle for the GitHub user account. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The ID corresponding to the budget. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/DELETE/path/budget_id`. + public var budgetId: Components.Parameters.Budget /// Creates a new `Path`. /// /// - Parameters: - /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username + /// - org: The organization name. The name is not case sensitive. + /// - budgetId: The ID corresponding to the budget. + public init( + org: Components.Parameters.Org, + budgetId: Components.Parameters.Budget + ) { + self.org = org + self.budgetId = budgetId } } - public var path: Operations.BillingGetGithubActionsBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/header`. + public var path: Operations.BillingDeleteBudgetOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_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.BillingGetGithubActionsBillingUser.Input.Headers + public var headers: Operations.BillingDeleteBudgetOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.BillingGetGithubActionsBillingUser.Input.Path, - headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers = .init() + path: Operations.BillingDeleteBudgetOrg.Input.Path, + headers: Operations.BillingDeleteBudgetOrg.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsBillingUsage) - /// 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.ActionsBillingUsage { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body) { - self.body = body - } - } - /// Response + /// Response when deleting a budget /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubActionsBillingUser.Output.Ok) + case ok(Components.Responses.DeleteBudget) /// 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.BillingGetGithubActionsBillingUser.Output.Ok { + public var ok: Components.Responses.DeleteBudget { get throws { switch self { case let .ok(response): @@ -2658,6 +3654,121 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -2665,11 +3776,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -2680,115 +3794,758 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get GitHub Packages billing for a user - /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// Get billing premium request usage report for an organization /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. - public enum BillingGetGithubPackagesBillingUser { - public static let id: Swift.String = "billing/get-github-packages-billing-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path`. - public struct Path: Sendable, Hashable { - /// The handle for the GitHub user account. + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public enum BillingGetGithubBillingPremiumRequestUsageReportOrg { + public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/user`. + public var user: Components.Parameters.BillingUsageReportUser? + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/model`. + public var model: Components.Parameters.BillingUsageReportModel? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - user: The user name to query usage for. The name is not case sensitive. + /// - model: The model name to query usage for. The name is not case sensitive. + /// - product: The product name to query usage for. The name is not case sensitive. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + user: Components.Parameters.BillingUsageReportUser? = nil, + model: Components.Parameters.BillingUsageReportModel? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil + ) { + self.year = year + self.month = month + self.day = day + self.user = user + self.model = model + self.product = product + } + } + public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response when getting a billing premium request usage report + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingPremiumRequestUsageReportOrg) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public enum BillingGetGithubBillingUsageReportOrg { + public static let id: Swift.String = "billing/get-github-billing-usage-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonth? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonth? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil + ) { + self.year = year + self.month = month + self.day = day + } + } + public var query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Billing usage report response for an organization + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingUsageReportOrg) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingUsageReportOrg { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get billing usage summary for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`. + public enum BillingGetGithubBillingUsageSummaryReportOrg { + public static let id: Swift.String = "billing/get-github-billing-usage-summary-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// The repository name to query for usage in the format owner/repository. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/repository`. + public var repository: Components.Parameters.BillingUsageReportRepository? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// The SKU to query for usage. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/GET/query/sku`. + public var sku: Components.Parameters.BillingUsageReportSku? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - repository: The repository name to query for usage in the format owner/repository. + /// - product: The product name to query usage for. The name is not case sensitive. + /// - sku: The SKU to query for usage. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + repository: Components.Parameters.BillingUsageReportRepository? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil, + sku: Components.Parameters.BillingUsageReportSku? = nil + ) { + self.year = year + self.month = month + self.day = day + self.repository = repository + self.product = product + self.sku = sku } } - public var path: Operations.BillingGetGithubPackagesBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/header`. + public var query: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/summary/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.BillingGetGithubPackagesBillingUser.Input.Headers + public var headers: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.BillingGetGithubPackagesBillingUser.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers = .init() + path: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content/application\/json`. - case json(Components.Schemas.PackagesBillingUsage) - /// 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.PackagesBillingUsage { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body) { - self.body = body - } - } - /// Response + /// Response when getting a billing usage summary /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubPackagesBillingUser.Output.Ok) + case ok(Components.Responses.BillingUsageSummaryReportOrg) /// 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.BillingGetGithubPackagesBillingUser.Output.Ok { + public var ok: Components.Responses.BillingUsageSummaryReportOrg { get throws { switch self { case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", response: self ) } @@ -2801,11 +4558,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -2816,11 +4576,14 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } @@ -3100,24 +4863,22 @@ public enum Operations { } } } - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Get billing usage report for a user /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of the total usage for a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - public enum BillingGetSharedStorageBillingUser { - public static let id: Swift.String = "billing/get-shared-storage-billing-user" + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + public enum BillingGetGithubBillingUsageReportUser { + public static let id: Swift.String = "billing/get-github-billing-usage-report-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path`. public struct Path: Sendable, Hashable { /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -3127,72 +4888,78 @@ public enum Operations { self.username = username } } - public var path: Operations.BillingGetSharedStorageBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/header`. + public var path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonth? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonth? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil + ) { + self.year = year + self.month = month + self.day = day + } + } + public var query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/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.BillingGetSharedStorageBillingUser.Input.Headers + public var headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.BillingGetSharedStorageBillingUser.Input.Path, - headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers = .init() + path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CombinedBillingUsage) - /// 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.CombinedBillingUsage { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body) { - self.body = body - } - } - /// Response + /// Response when getting a billing usage report /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetSharedStorageBillingUser.Output.Ok) + case ok(Components.Responses.BillingUsageReportUser) /// 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.BillingGetSharedStorageBillingUser.Output.Ok { + public var ok: Components.Responses.BillingUsageReportUser { get throws { switch self { case let .ok(response): @@ -3205,6 +4972,98 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -3212,11 +5071,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -3227,31 +5089,37 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get billing usage report for a user + /// Get billing usage summary for a user /// - /// Gets a report of the total usage for a user. + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. /// - /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. + /// Gets a summary report of usage for a user. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. - public enum BillingGetGithubBillingUsageReportUser { - public static let id: Swift.String = "billing/get-github-billing-usage-report-user" + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`. + public enum BillingGetGithubBillingUsageSummaryReportUser { + public static let id: Swift.String = "billing/get-github-billing-usage-summary-report-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/path`. public struct Path: Sendable, Hashable { /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -3261,57 +5129,71 @@ public enum Operations { self.username = username } } - public var path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query`. + public var path: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query`. public struct Query: Sendable, Hashable { /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/year`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/year`. public var year: Components.Parameters.BillingUsageReportYear? - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/month`. - public var month: Components.Parameters.BillingUsageReportMonth? + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/day`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/day`. public var day: Components.Parameters.BillingUsageReportDay? - /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// The repository name to query for usage in the format owner/repository. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/repository`. + public var repository: Components.Parameters.BillingUsageReportRepository? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// The SKU to query for usage. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/hour`. - public var hour: Components.Parameters.BillingUsageReportHour? + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/GET/query/sku`. + public var sku: Components.Parameters.BillingUsageReportSku? /// Creates a new `Query`. /// /// - Parameters: /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// - repository: The repository name to query for usage in the format owner/repository. + /// - product: The product name to query usage for. The name is not case sensitive. + /// - sku: The SKU to query for usage. public init( year: Components.Parameters.BillingUsageReportYear? = nil, - month: Components.Parameters.BillingUsageReportMonth? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, day: Components.Parameters.BillingUsageReportDay? = nil, - hour: Components.Parameters.BillingUsageReportHour? = nil + repository: Components.Parameters.BillingUsageReportRepository? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil, + sku: Components.Parameters.BillingUsageReportSku? = nil ) { self.year = year self.month = month self.day = day - self.hour = hour + self.repository = repository + self.product = product + self.sku = sku } } - public var query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/header`. + public var query: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/summary/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.BillingGetGithubBillingUsageReportUser.Input.Headers + public var headers: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -3319,9 +5201,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path, - query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers = .init() + path: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Path, + query: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Headers = .init() ) { self.path = path self.query = query @@ -3329,17 +5211,17 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - /// Response when getting a billing usage report + /// Response when getting a billing usage summary /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.BillingUsageReportUser) + case ok(Components.Responses.BillingUsageSummaryReportUser) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.BillingUsageReportUser { + public var ok: Components.Responses.BillingUsageSummaryReportUser { get throws { switch self { case let .ok(response): @@ -3354,7 +5236,7 @@ public enum Operations { } /// Bad Request /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/400`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/400`. /// /// HTTP response code: `400 badRequest`. case badRequest(Components.Responses.BadRequest) @@ -3377,7 +5259,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -3398,9 +5280,32 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Internal Error /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/500`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -3423,7 +5328,7 @@ public enum Operations { } /// Service unavailable /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/503`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. case serviceUnavailable(Components.Responses.ServiceUnavailable) From 1b6fb1a4f7e4b793cb43399482c6ee103aac7318 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:06:03 +0000 Subject: [PATCH 06/33] Commit via running: make Sources/checks --- Sources/checks/Types.swift | 490 ++++++++++++++++++++++++------------- 1 file changed, 315 insertions(+), 175 deletions(-) diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index 8d870a6c47..589804622f 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -748,8 +748,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -768,7 +768,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -840,7 +840,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -870,7 +870,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -972,6 +972,163 @@ public enum Components { case installationsCount = "installations_count" } } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. + public struct PullRequestMinimal: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public var head: Components.Schemas.PullRequestMinimal.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public var base: Components.Schemas.PullRequestMinimal.BasePayload + /// Creates a new `PullRequestMinimal`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - url: + /// - head: + /// - base: + public init( + id: Swift.Int64, + number: Swift.Int, + url: Swift.String, + head: Components.Schemas.PullRequestMinimal.HeadPayload, + base: Components.Schemas.PullRequestMinimal.BasePayload + ) { + self.id = id + self.number = number + self.url = url + self.head = head + self.base = base + } + public enum CodingKeys: String, CodingKey { + case id + case number + case url + case head + case base + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { /// Enable or disable GitHub Advanced Security for the repository. @@ -1146,6 +1303,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -1156,6 +1414,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -1163,7 +1424,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -1172,6 +1436,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -1181,6 +1448,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -1323,6 +1593,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -1458,10 +1743,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -1539,6 +1824,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -1628,6 +1916,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -1717,6 +2008,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -1807,6 +2101,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -1836,167 +2133,10 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. - public struct PullRequestMinimal: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. - public struct RepoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. - public var name: Swift.String - /// Creates a new `RepoPayload`. - /// - /// - Parameters: - /// - id: - /// - url: - /// - name: - public init( - id: Swift.Int64, - url: Swift.String, - name: Swift.String - ) { - self.id = id - self.url = url - self.name = name - } - public enum CodingKeys: String, CodingKey { - case id - case url - case name - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. - public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - ref: - /// - sha: - /// - repo: - public init( - ref: Swift.String, - sha: Swift.String, - repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload - ) { - self.ref = ref - self.sha = sha - self.repo = repo - } - public enum CodingKeys: String, CodingKey { - case ref - case sha - case repo - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. - public var head: Components.Schemas.PullRequestMinimal.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. - public struct RepoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. - public var name: Swift.String - /// Creates a new `RepoPayload`. - /// - /// - Parameters: - /// - id: - /// - url: - /// - name: - public init( - id: Swift.Int64, - url: Swift.String, - name: Swift.String - ) { - self.id = id - self.url = url - self.name = name - } - public enum CodingKeys: String, CodingKey { - case id - case url - case name - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. - public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload - /// Creates a new `BasePayload`. - /// - /// - Parameters: - /// - ref: - /// - sha: - /// - repo: - public init( - ref: Swift.String, - sha: Swift.String, - repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload - ) { - self.ref = ref - self.sha = sha - self.repo = repo - } - public enum CodingKeys: String, CodingKey { - case ref - case sha - case repo - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. - public var base: Components.Schemas.PullRequestMinimal.BasePayload - /// Creates a new `PullRequestMinimal`. - /// - /// - Parameters: - /// - id: - /// - number: - /// - url: - /// - head: - /// - base: - public init( - id: Swift.Int64, - number: Swift.Int, - url: Swift.String, - head: Components.Schemas.PullRequestMinimal.HeadPayload, - base: Components.Schemas.PullRequestMinimal.BasePayload - ) { - self.id = id - self.number = number - self.url = url - self.head = head - self.base = base - } - public enum CodingKeys: String, CodingKey { - case id - case number - case url - case head - case base - } - } /// A deployment created as the result of an Actions check run from a workflow that references an environment /// /// - Remark: Generated from `#/components/schemas/deployment-simple`. @@ -2863,7 +3003,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case status } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let discriminator = try container.decode( Swift.String.self, @@ -2878,7 +3018,7 @@ public enum Operations { ) } } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { } } @@ -3221,7 +3361,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case status } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.status = try container.decodeIfPresent( OpenAPIRuntime.OpenAPIValueContainer.self, @@ -3231,7 +3371,7 @@ public enum Operations { "status" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.status, @@ -3263,7 +3403,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case status } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.status = try container.decodeIfPresent( OpenAPIRuntime.OpenAPIValueContainer.self, @@ -3273,7 +3413,7 @@ public enum Operations { "status" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.status, @@ -3296,8 +3436,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -3318,7 +3458,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } From d22e497f8db2851422e4222e1a8eb0a10ed0c022 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:06:25 +0000 Subject: [PATCH 07/33] Commit via running: make Sources/code-scanning --- Sources/code-scanning/Client.swift | 26 ++- Sources/code-scanning/Types.swift | 262 ++++++++++++++++++++++------- 2 files changed, 222 insertions(+), 66 deletions(-) diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 9ff3b2c90f..608ed3873f 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -134,6 +134,13 @@ public struct Client: APIProtocol { name: "severity", value: input.query.severity ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignees", + value: input.query.assignees + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -341,6 +348,13 @@ public struct Client: APIProtocol { name: "severity", value: input.query.severity ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignees", + value: input.query.assignees + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1345,7 +1359,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.CodeScanningAlertInstance].self, + [Components.Schemas.CodeScanningAlertInstanceList].self, from: responseBody, transforming: { value in .json(value) @@ -1696,7 +1710,7 @@ public struct Client: APIProtocol { received: contentType, options: [ "application/json", - "application/json+sarif" + "application/sarif+json" ] ) switch chosenContentType { @@ -1708,12 +1722,12 @@ public struct Client: APIProtocol { .json(value) } ) - case "application/json+sarif": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, + case "application/sarif+json": + body = try await converter.getResponseBodyAsJSON( + Operations.CodeScanningGetAnalysis.Output.Ok.Body.ApplicationSarifJsonPayload.self, from: responseBody, transforming: { value in - .applicationJsonSarif(value) + .applicationSarifJson(value) } ) default: diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 4328222bbc..99b5c8fbbd 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -1673,7 +1673,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -2468,17 +2468,6 @@ public enum Components { case assignees } } - /// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. - /// - /// - Remark: Generated from `#/components/schemas/code-scanning-alert-set-state`. - @frozen public enum CodeScanningAlertSetState: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case dismissed = "dismissed" - } - /// If `true`, attempt to create an alert dismissal request. - /// - /// - Remark: Generated from `#/components/schemas/code-scanning-alert-create-request`. - public typealias CodeScanningAlertCreateRequest = Swift.Bool /// The status of an autofix. /// /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-status`. @@ -2581,6 +2570,102 @@ public enum Components { case sha } } + /// State of a code scanning alert instance. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-state`. + @frozen public enum CodeScanningAlertInstanceState: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case fixed = "fixed" + } + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list`. + public struct CodeScanningAlertInstanceList: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/ref`. + public var ref: Components.Schemas.CodeScanningRef? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/analysis_key`. + public var analysisKey: Components.Schemas.CodeScanningAnalysisAnalysisKey? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/environment`. + public var environment: Components.Schemas.CodeScanningAlertEnvironment? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/category`. + public var category: Components.Schemas.CodeScanningAnalysisCategory? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/state`. + public var state: Components.Schemas.CodeScanningAlertInstanceState? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/commit_sha`. + public var commitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/message`. + public struct MessagePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/message/text`. + public var text: Swift.String? + /// Creates a new `MessagePayload`. + /// + /// - Parameters: + /// - text: + public init(text: Swift.String? = nil) { + self.text = text + } + public enum CodingKeys: String, CodingKey { + case text + } + } + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/message`. + public var message: Components.Schemas.CodeScanningAlertInstanceList.MessagePayload? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/location`. + public var location: Components.Schemas.CodeScanningAlertLocation? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/html_url`. + public var htmlUrl: Swift.String? + /// Classifications that have been applied to the file that triggered the alert. + /// For example identifying it as documentation, or a generated file. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance-list/classifications`. + public var classifications: [Components.Schemas.CodeScanningAlertClassification]? + /// Creates a new `CodeScanningAlertInstanceList`. + /// + /// - Parameters: + /// - ref: + /// - analysisKey: + /// - environment: + /// - category: + /// - state: + /// - commitSha: + /// - message: + /// - location: + /// - htmlUrl: + /// - classifications: Classifications that have been applied to the file that triggered the alert. + public init( + ref: Components.Schemas.CodeScanningRef? = nil, + analysisKey: Components.Schemas.CodeScanningAnalysisAnalysisKey? = nil, + environment: Components.Schemas.CodeScanningAlertEnvironment? = nil, + category: Components.Schemas.CodeScanningAnalysisCategory? = nil, + state: Components.Schemas.CodeScanningAlertInstanceState? = nil, + commitSha: Swift.String? = nil, + message: Components.Schemas.CodeScanningAlertInstanceList.MessagePayload? = nil, + location: Components.Schemas.CodeScanningAlertLocation? = nil, + htmlUrl: Swift.String? = nil, + classifications: [Components.Schemas.CodeScanningAlertClassification]? = nil + ) { + self.ref = ref + self.analysisKey = analysisKey + self.environment = environment + self.category = category + self.state = state + self.commitSha = commitSha + self.message = message + self.location = location + self.htmlUrl = htmlUrl + self.classifications = classifications + } + public enum CodingKeys: String, CodingKey { + case ref + case analysisKey = "analysis_key" + case environment + case category + case state + case commitSha = "commit_sha" + case message + case location + case htmlUrl = "html_url" + case classifications + } + } /// An identifier for the upload. /// /// - Remark: Generated from `#/components/schemas/code-scanning-analysis-sarif-id`. @@ -2834,6 +2919,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-variant-analysis-language`. @frozen public enum CodeScanningVariantAnalysisLanguage: String, Codable, Hashable, Sendable, CaseIterable { + case actions = "actions" case cpp = "cpp" case csharp = "csharp" case go = "go" @@ -3478,7 +3564,7 @@ public enum Components { case threatModel = "threat_model" case languages } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.state = try container.decodeIfPresent( Components.Schemas.CodeScanningDefaultSetupUpdate.StatePayload.self, @@ -4115,6 +4201,12 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-scanning/alerts/GET/query/severity`. public var severity: Components.Schemas.CodeScanningAlertSeverity? + /// Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-scanning/alerts/GET/query/assignees`. + public var assignees: Swift.String? /// Creates a new `Query`. /// /// - Parameters: @@ -4128,6 +4220,7 @@ public enum Operations { /// - state: If specified, only code scanning alerts with this state will be returned. /// - sort: The property by which to sort the results. /// - severity: If specified, only code scanning alerts with this severity will be returned. + /// - assignees: Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). public init( toolName: Components.Parameters.ToolName? = nil, toolGuid: Components.Parameters.ToolGuid? = nil, @@ -4138,7 +4231,8 @@ public enum Operations { direction: Components.Parameters.Direction? = nil, state: Components.Schemas.CodeScanningAlertStateQuery? = nil, sort: Operations.CodeScanningListAlertsForOrg.Input.Query.SortPayload? = nil, - severity: Components.Schemas.CodeScanningAlertSeverity? = nil + severity: Components.Schemas.CodeScanningAlertSeverity? = nil, + assignees: Swift.String? = nil ) { self.toolName = toolName self.toolGuid = toolGuid @@ -4150,6 +4244,7 @@ public enum Operations { self.state = state self.sort = sort self.severity = severity + self.assignees = assignees } } public var query: Operations.CodeScanningListAlertsForOrg.Input.Query @@ -4428,6 +4523,12 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/severity`. public var severity: Components.Schemas.CodeScanningAlertSeverity? + /// Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/assignees`. + public var assignees: Swift.String? /// Creates a new `Query`. /// /// - Parameters: @@ -4443,6 +4544,7 @@ public enum Operations { /// - sort: The property by which to sort the results. /// - state: If specified, only code scanning alerts with this state will be returned. /// - severity: If specified, only code scanning alerts with this severity will be returned. + /// - assignees: Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). public init( toolName: Components.Parameters.ToolName? = nil, toolGuid: Components.Parameters.ToolGuid? = nil, @@ -4455,7 +4557,8 @@ public enum Operations { after: Components.Parameters.PaginationAfter? = nil, sort: Operations.CodeScanningListAlertsForRepo.Input.Query.SortPayload? = nil, state: Components.Schemas.CodeScanningAlertStateQuery? = nil, - severity: Components.Schemas.CodeScanningAlertSeverity? = nil + severity: Components.Schemas.CodeScanningAlertSeverity? = nil, + assignees: Swift.String? = nil ) { self.toolName = toolName self.toolGuid = toolGuid @@ -4469,6 +4572,7 @@ public enum Operations { self.sort = sort self.state = state self.severity = severity + self.assignees = assignees } } public var query: Operations.CodeScanningListAlertsForRepo.Input.Query @@ -4990,37 +5094,57 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/state`. - public var state: Components.Schemas.CodeScanningAlertSetState - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/dismissed_reason`. - public var dismissedReason: Components.Schemas.CodeScanningAlertDismissedReason? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/dismissed_comment`. - public var dismissedComment: Components.Schemas.CodeScanningAlertDismissedComment? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/create_request`. - public var createRequest: Components.Schemas.CodeScanningAlertCreateRequest? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Creates a new `Value1Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public var value1: Operations.CodeScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Creates a new `Value2Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public var value2: Operations.CodeScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - state: - /// - dismissedReason: - /// - dismissedComment: - /// - createRequest: + /// - value1: + /// - value2: public init( - state: Components.Schemas.CodeScanningAlertSetState, - dismissedReason: Components.Schemas.CodeScanningAlertDismissedReason? = nil, - dismissedComment: Components.Schemas.CodeScanningAlertDismissedComment? = nil, - createRequest: Components.Schemas.CodeScanningAlertCreateRequest? = nil + value1: Operations.CodeScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? = nil, + value2: Operations.CodeScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? = nil ) { - self.state = state - self.dismissedReason = dismissedReason - self.dismissedComment = dismissedComment - self.createRequest = createRequest + self.value1 = value1 + self.value2 = value2 } - public enum CodingKeys: String, CodingKey { - case state - case dismissedReason = "dismissed_reason" - case dismissedComment = "dismissed_comment" - case createRequest = "create_request" + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. @@ -6199,12 +6323,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances/GET/responses/200/content/application\/json`. - case json([Components.Schemas.CodeScanningAlertInstance]) + case json([Components.Schemas.CodeScanningAlertInstanceList]) /// 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.CodeScanningAlertInstance] { + public var json: [Components.Schemas.CodeScanningAlertInstanceList] { get throws { switch self { case let .json(body): @@ -6759,20 +6883,38 @@ public enum Operations { } } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}/GET/responses/200/content/application\/json+sarif`. - case applicationJsonSarif(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.applicationJsonSarif`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}/GET/responses/200/content/applicationSarifJson`. + public struct ApplicationSarifJsonPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ApplicationSarifJsonPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}/GET/responses/200/content/application\/sarif+json`. + case applicationSarifJson(Operations.CodeScanningGetAnalysis.Output.Ok.Body.ApplicationSarifJsonPayload) + /// The associated value of the enum case if `self` is `.applicationSarifJson`. /// - /// - Throws: An error if `self` is not `.applicationJsonSarif`. - /// - SeeAlso: `.applicationJsonSarif`. - public var applicationJsonSarif: OpenAPIRuntime.HTTPBody { + /// - Throws: An error if `self` is not `.applicationSarifJson`. + /// - SeeAlso: `.applicationSarifJson`. + public var applicationSarifJson: Operations.CodeScanningGetAnalysis.Output.Ok.Body.ApplicationSarifJsonPayload { get throws { switch self { - case let .applicationJsonSarif(body): + case let .applicationSarifJson(body): return body default: try throwUnexpectedResponseBody( - expectedContent: "application/json+sarif", + expectedContent: "application/sarif+json", body: self ) } @@ -6911,14 +7053,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationJsonSarif + case applicationSarifJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/json+sarif": - self = .applicationJsonSarif + case "application/sarif+json": + self = .applicationSarifJson default: self = .other(rawValue) } @@ -6929,14 +7071,14 @@ public enum Operations { return string case .json: return "application/json" - case .applicationJsonSarif: - return "application/json+sarif" + case .applicationSarifJson: + return "application/sarif+json" } } public static var allCases: [Self] { [ .json, - .applicationJsonSarif + .applicationSarifJson ] } } @@ -8016,8 +8158,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/POST/requestBody/json/case3`. case case3(Operations.CodeScanningCreateVariantAnalysis.Input.Body.JsonPayload.Case3Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -8042,7 +8184,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -9331,7 +9473,7 @@ public enum Operations { case toolName = "tool_name" case validate } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.commitSha = try container.decode( Components.Schemas.CodeScanningAnalysisCommitSha.self, From 239e865161ffed5539f7a2a63ea20df36e51816c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:07:10 +0000 Subject: [PATCH 08/33] Commit via running: make Sources/emojis --- Sources/emojis/Types.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/emojis/Types.swift b/Sources/emojis/Types.swift index fa7369913e..1e63d51d7d 100644 --- a/Sources/emojis/Types.swift +++ b/Sources/emojis/Types.swift @@ -117,10 +117,10 @@ public enum Operations { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } From 84ea8f1799694f5cb0d8cbebc53a7b5aa8a38392 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:07:32 +0000 Subject: [PATCH 09/33] Commit via running: make Sources/dependabot --- Sources/dependabot/Client.swift | 33 ++- Sources/dependabot/Types.swift | 508 +++++++++++++++++++++++++------- 2 files changed, 427 insertions(+), 114 deletions(-) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 96fe48e822..00cb59268a 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -108,6 +108,13 @@ public struct Client: APIProtocol { name: "has", value: input.query.has ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -679,6 +686,13 @@ public struct Client: APIProtocol { name: "has", value: input.query.has ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1518,6 +1532,13 @@ public struct Client: APIProtocol { name: "has", value: input.query.has ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1543,22 +1564,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "before", + value: input.query.before ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "before", - value: input.query.before + name: "after", + value: input.query.after ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "after", - value: input.query.after + name: "per_page", + value: input.query.perPage ) converter.setAcceptHeader( in: &request.headerFields, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 56d7e77aca..5bf3e69d08 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -1637,7 +1637,7 @@ public enum Components { case ecosystem case name } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.ecosystem = try container.decode( Swift.String.self, @@ -1694,7 +1694,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case identifier } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.identifier = try container.decode( Swift.String.self, @@ -1733,7 +1733,7 @@ public enum Components { case vulnerableVersionRange = "vulnerable_version_range" case firstPatchedVersion = "first_patched_version" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.package = try container.decode( Components.Schemas.DependabotAlertPackage.self, @@ -1824,7 +1824,7 @@ public enum Components { case score case vectorString = "vector_string" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.score = try container.decode( Swift.Double.self, @@ -1876,7 +1876,7 @@ public enum Components { case cweId = "cwe_id" case name } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.cweId = try container.decode( Swift.String.self, @@ -1935,7 +1935,7 @@ public enum Components { case _type = "type" case value } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self._type = try container.decode( Components.Schemas.DependabotAlertSecurityAdvisory.IdentifiersPayloadPayload._TypePayload.self, @@ -1977,7 +1977,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case url } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.url = try container.decode( Swift.String.self, @@ -2076,7 +2076,7 @@ public enum Components { case updatedAt = "updated_at" case withdrawnAt = "withdrawn_at" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.ghsaId = try container.decode( Swift.String.self, @@ -2185,6 +2185,97 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/alert-auto-dismissed-at`. public typealias AlertAutoDismissedAt = Foundation.Date + /// Information about an active dismissal request for this Dependabot alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple`. + public struct DependabotAlertDismissalRequestSimple: Codable, Hashable, Sendable { + /// The unique identifier of the dismissal request. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/id`. + public var id: Swift.Int? + /// The current status of the dismissal request. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pending = "pending" + case approved = "approved" + case rejected = "rejected" + case cancelled = "cancelled" + } + /// The current status of the dismissal request. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/status`. + public var status: Components.Schemas.DependabotAlertDismissalRequestSimple.StatusPayload? + /// The user who requested the dismissal. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/requester`. + public struct RequesterPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/requester/id`. + public var id: Swift.Int? + /// The login name of the user. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/requester/login`. + public var login: Swift.String? + /// Creates a new `RequesterPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user. + /// - login: The login name of the user. + public init( + id: Swift.Int? = nil, + login: Swift.String? = nil + ) { + self.id = id + self.login = login + } + public enum CodingKeys: String, CodingKey { + case id + case login + } + } + /// The user who requested the dismissal. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/requester`. + public var requester: Components.Schemas.DependabotAlertDismissalRequestSimple.RequesterPayload? + /// The date and time when the dismissal request was created. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/created_at`. + public var createdAt: Foundation.Date? + /// The API URL to get more information about this dismissal request. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-dismissal-request-simple/url`. + public var url: Swift.String? + /// Creates a new `DependabotAlertDismissalRequestSimple`. + /// + /// - Parameters: + /// - id: The unique identifier of the dismissal request. + /// - status: The current status of the dismissal request. + /// - requester: The user who requested the dismissal. + /// - createdAt: The date and time when the dismissal request was created. + /// - url: The API URL to get more information about this dismissal request. + public init( + id: Swift.Int? = nil, + status: Components.Schemas.DependabotAlertDismissalRequestSimple.StatusPayload? = nil, + requester: Components.Schemas.DependabotAlertDismissalRequestSimple.RequesterPayload? = nil, + createdAt: Foundation.Date? = nil, + url: Swift.String? = nil + ) { + self.id = id + self.status = status + self.requester = requester + self.createdAt = createdAt + self.url = url + } + public enum CodingKeys: String, CodingKey { + case id + case status + case requester + case createdAt = "created_at" + case url + } + } /// A Dependabot alert. /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository`. @@ -2312,6 +2403,12 @@ public enum Components { public var fixedAt: Components.Schemas.AlertFixedAt? /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/auto_dismissed_at`. public var autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? + /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/dismissal_request`. + public var dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? + /// The users assigned to this alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/repository`. public var repository: Components.Schemas.SimpleRepository /// Creates a new `DependabotAlertWithRepository`. @@ -2332,6 +2429,8 @@ public enum Components { /// - dismissedComment: An optional comment associated with the alert's dismissal. /// - fixedAt: /// - autoDismissedAt: + /// - dismissalRequest: + /// - assignees: The users assigned to this alert. /// - repository: public init( number: Components.Schemas.AlertNumber, @@ -2349,6 +2448,8 @@ public enum Components { dismissedComment: Swift.String? = nil, fixedAt: Components.Schemas.AlertFixedAt? = nil, autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil, + dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, repository: Components.Schemas.SimpleRepository ) { self.number = number @@ -2366,6 +2467,8 @@ public enum Components { self.dismissedComment = dismissedComment self.fixedAt = fixedAt self.autoDismissedAt = autoDismissedAt + self.dismissalRequest = dismissalRequest + self.assignees = assignees self.repository = repository } public enum CodingKeys: String, CodingKey { @@ -2384,9 +2487,11 @@ public enum Components { case dismissedComment = "dismissed_comment" case fixedAt = "fixed_at" case autoDismissedAt = "auto_dismissed_at" + case dismissalRequest = "dismissal_request" + case assignees case repository } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.number = try container.decode( Components.Schemas.AlertNumber.self, @@ -2448,6 +2553,14 @@ public enum Components { Components.Schemas.AlertAutoDismissedAt.self, forKey: .autoDismissedAt ) + self.dismissalRequest = try container.decodeIfPresent( + Components.Schemas.DependabotAlertDismissalRequestSimple.self, + forKey: .dismissalRequest + ) + self.assignees = try container.decodeIfPresent( + [Components.Schemas.SimpleUser].self, + forKey: .assignees + ) self.repository = try container.decode( Components.Schemas.SimpleRepository.self, forKey: .repository @@ -2468,6 +2581,8 @@ public enum Components { "dismissed_comment", "fixed_at", "auto_dismissed_at", + "dismissal_request", + "assignees", "repository" ]) } @@ -2646,6 +2761,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2656,6 +2872,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2663,7 +2882,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2672,6 +2894,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2681,6 +2906,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -2823,6 +3051,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2958,10 +3201,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3039,6 +3282,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3128,6 +3374,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3217,6 +3466,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3307,6 +3559,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3742,7 +3997,7 @@ public enum Components { case defaultLevel = "default_level" case accessibleRepositories = "accessible_repositories" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.defaultLevel = try container.decodeIfPresent( Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload.self, @@ -3764,7 +4019,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -3979,6 +4234,12 @@ public enum Components { public var fixedAt: Components.Schemas.AlertFixedAt? /// - Remark: Generated from `#/components/schemas/dependabot-alert/auto_dismissed_at`. public var autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissal_request`. + public var dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? + /// The users assigned to this alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `DependabotAlert`. /// /// - Parameters: @@ -3997,6 +4258,8 @@ public enum Components { /// - dismissedComment: An optional comment associated with the alert's dismissal. /// - fixedAt: /// - autoDismissedAt: + /// - dismissalRequest: + /// - assignees: The users assigned to this alert. public init( number: Components.Schemas.AlertNumber, state: Components.Schemas.DependabotAlert.StatePayload, @@ -4012,7 +4275,9 @@ public enum Components { dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? = nil, dismissedComment: Swift.String? = nil, fixedAt: Components.Schemas.AlertFixedAt? = nil, - autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil + autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil, + dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.state = state @@ -4029,6 +4294,8 @@ public enum Components { self.dismissedComment = dismissedComment self.fixedAt = fixedAt self.autoDismissedAt = autoDismissedAt + self.dismissalRequest = dismissalRequest + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -4046,8 +4313,10 @@ public enum Components { case dismissedComment = "dismissed_comment" case fixedAt = "fixed_at" case autoDismissedAt = "auto_dismissed_at" + case dismissalRequest = "dismissal_request" + case assignees } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.number = try container.decode( Components.Schemas.AlertNumber.self, @@ -4109,6 +4378,14 @@ public enum Components { Components.Schemas.AlertAutoDismissedAt.self, forKey: .autoDismissedAt ) + self.dismissalRequest = try container.decodeIfPresent( + Components.Schemas.DependabotAlertDismissalRequestSimple.self, + forKey: .dismissalRequest + ) + self.assignees = try container.decodeIfPresent( + [Components.Schemas.SimpleUser].self, + forKey: .assignees + ) try decoder.ensureNoAdditionalProperties(knownKeys: [ "number", "state", @@ -4124,7 +4401,9 @@ public enum Components { "dismissed_reason", "dismissed_comment", "fixed_at", - "auto_dismissed_at" + "auto_dismissed_at", + "dismissal_request", + "assignees" ]) } } @@ -4237,8 +4516,8 @@ public enum Components { public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -4257,7 +4536,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -4266,6 +4545,12 @@ public enum Components { } } } + /// Filter alerts by assignees. + /// Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`) to return alerts assigned to any of the specified users. + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-assignees`. + public typealias DependabotAlertCommaSeparatedAssignees = Swift.String /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @@ -4326,8 +4611,8 @@ public enum Components { public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -4346,7 +4631,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -4630,8 +4915,8 @@ public enum Operations { public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -4650,7 +4935,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -4664,6 +4949,12 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/has`. public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? + /// Filter alerts by assignees. + /// Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`) to return alerts assigned to any of the specified users. + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { case development = "development" @@ -4716,6 +5007,7 @@ public enum Operations { /// - 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: /// - 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. + /// - assignee: Filter alerts by assignees. /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. @@ -4729,6 +5021,7 @@ public enum Operations { package: Components.Parameters.DependabotAlertCommaSeparatedPackages? = nil, epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, + assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, direction: Components.Parameters.Direction? = nil, @@ -4742,6 +5035,7 @@ public enum Operations { self.package = package self.epssPercentage = epssPercentage self.has = has + self.assignee = assignee self.scope = scope self.sort = sort self.direction = direction @@ -5665,8 +5959,8 @@ public enum Operations { public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -5685,7 +5979,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -5699,6 +5993,12 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/has`. public var has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? + /// Filter alerts by assignees. + /// Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`) to return alerts assigned to any of the specified users. + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. /// /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` @@ -5759,6 +6059,7 @@ public enum Operations { /// - artifactRegistryUrl: A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. /// - artifactRegistry: A comma-separated list of Artifact 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. + /// - assignee: Filter alerts by assignees. /// - runtimeRisk: A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks 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. @@ -5775,6 +6076,7 @@ public enum Operations { artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? = nil, artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? = nil, has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? = nil, + assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? = nil, runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, @@ -5791,6 +6093,7 @@ public enum Operations { self.artifactRegistryUrl = artifactRegistryUrl self.artifactRegistry = artifactRegistry self.has = has + self.assignee = assignee self.runtimeRisk = runtimeRisk self.scope = scope self.sort = sort @@ -6613,8 +6916,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -6635,18 +6938,18 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2 ]) } } - /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. + /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. public typealias SelectedRepositoryIdsPayload = [Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayloadPayload] - /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. + /// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? @@ -6656,7 +6959,7 @@ public enum Operations { /// - encryptedValue: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint. /// - keyId: ID of the key you used to encrypt the secret. /// - visibility: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. - /// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future. + /// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. public init( encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, @@ -7543,8 +7846,8 @@ public enum Operations { public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -7563,7 +7866,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -7577,6 +7880,12 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/has`. public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? + /// Filter alerts by assignees. + /// Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`) to return alerts assigned to any of the specified users. + /// Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { case development = "development" @@ -7608,11 +7917,6 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/direction`. public var direction: Components.Parameters.Direction? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/per_page`. - @available(*, deprecated) - public var perPage: Swift.Int? /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/before`. @@ -7621,6 +7925,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/after`. public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? /// Creates a new `Query`. /// /// - Parameters: @@ -7631,12 +7939,13 @@ public enum Operations { /// - manifest: A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. /// - epssPercentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: /// - 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. + /// - assignee: Filter alerts by assignees. /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. - /// - 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)." /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, @@ -7645,12 +7954,13 @@ public enum Operations { manifest: Components.Parameters.DependabotAlertCommaSeparatedManifests? = nil, epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, + assignee: Components.Parameters.DependabotAlertCommaSeparatedAssignees? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, direction: Components.Parameters.Direction? = nil, - perPage: Swift.Int? = nil, before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil ) { self.state = state self.severity = severity @@ -7659,12 +7969,13 @@ public enum Operations { self.manifest = manifest self.epssPercentage = epssPercentage self.has = has + self.assignee = assignee self.scope = scope self.sort = sort self.direction = direction - self.perPage = perPage self.before = before self.after = after + self.perPage = perPage } } public var query: Operations.DependabotListAlertsForRepo.Input.Query @@ -8197,76 +8508,57 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The state of the Dependabot alert. - /// A `dismissed_reason` must be provided when setting the state to `dismissed`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case dismissed = "dismissed" - case open = "open" + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Creates a new `Value1Payload`. + public init() {} } - /// The state of the Dependabot alert. - /// A `dismissed_reason` must be provided when setting the state to `dismissed`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/state`. - public var state: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.StatePayload - /// **Required when `state` is `dismissed`.** A reason for dismissing the alert. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/dismissed_reason`. - @frozen public enum DismissedReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { - case fixStarted = "fix_started" - case inaccurate = "inaccurate" - case noBandwidth = "no_bandwidth" - case notUsed = "not_used" - case tolerableRisk = "tolerable_risk" + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public var value1: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.Value1Payload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Creates a new `Value2Payload`. + public init() {} } - /// **Required when `state` is `dismissed`.** A reason for dismissing the alert. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/dismissed_reason`. - public var dismissedReason: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.DismissedReasonPayload? - /// An optional comment associated with dismissing the alert. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/dismissed_comment`. - public var dismissedComment: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public var value2: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.Value2Payload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - state: The state of the Dependabot alert. - /// - dismissedReason: **Required when `state` is `dismissed`.** A reason for dismissing the alert. - /// - dismissedComment: An optional comment associated with dismissing the alert. + /// - value1: + /// - value2: public init( - state: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.StatePayload, - dismissedReason: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.DismissedReasonPayload? = nil, - dismissedComment: Swift.String? = nil + value1: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.Value1Payload? = nil, + value2: Operations.DependabotUpdateAlert.Input.Body.JsonPayload.Value2Payload? = nil ) { - self.state = state - self.dismissedReason = dismissedReason - self.dismissedComment = dismissedComment - } - public enum CodingKeys: String, CodingKey { - case state - case dismissedReason = "dismissed_reason" - case dismissedComment = "dismissed_comment" + self.value1 = value1 + self.value2 = value2 } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.state = try container.decode( - Operations.DependabotUpdateAlert.Input.Body.JsonPayload.StatePayload.self, - forKey: .state - ) - self.dismissedReason = try container.decodeIfPresent( - Operations.DependabotUpdateAlert.Input.Body.JsonPayload.DismissedReasonPayload.self, - forKey: .dismissedReason - ) - self.dismissedComment = try container.decodeIfPresent( - Swift.String.self, - forKey: .dismissedComment + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "state", - "dismissed_reason", - "dismissed_comment" - ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. From 40e865a2b0b2063b8db56f86aa1d96eae6151106 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:07:54 +0000 Subject: [PATCH 10/33] Commit via running: make Sources/dependency-graph --- Sources/dependency-graph/Types.swift | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Sources/dependency-graph/Types.swift b/Sources/dependency-graph/Types.swift index ca587a3d5e..86f5351bed 100644 --- a/Sources/dependency-graph/Types.swift +++ b/Sources/dependency-graph/Types.swift @@ -599,8 +599,8 @@ public enum Components { self.value2 = value2 self.value3 = value3 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -627,7 +627,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2, @@ -644,10 +644,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.Metadata.AdditionalPropertiesPayload?] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -713,7 +713,7 @@ public enum Components { case scope case dependencies } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.packageUrl = try container.decodeIfPresent( Swift.String.self, @@ -766,7 +766,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case sourceLocation = "source_location" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.sourceLocation = try container.decodeIfPresent( Swift.String.self, @@ -794,10 +794,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.Dependency] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -829,7 +829,7 @@ public enum Components { case metadata case resolved } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decode( Swift.String.self, @@ -897,7 +897,7 @@ public enum Components { case correlator case htmlUrl = "html_url" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decode( Swift.String.self, @@ -964,7 +964,7 @@ public enum Components { case version case url } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decode( Swift.String.self, @@ -1004,10 +1004,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.Manifest] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -1059,7 +1059,7 @@ public enum Components { case manifests case scanned } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.version = try container.decode( Swift.Int.self, From 02c148537742ccb0b0dd4e9ac3258883fa62c6d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:08:17 +0000 Subject: [PATCH 11/33] Commit via running: make Sources/gists --- Sources/gists/Types.swift | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index 1195d3d824..b9f94ba9a9 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -792,8 +792,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -818,7 +818,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1127,10 +1127,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.BaseGist.FilesPayload.AdditionalPropertiesPayload] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -1540,7 +1540,7 @@ public enum Components { case diskUsage = "disk_usage" case collaborators } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.login = try container.decode( Swift.String.self, @@ -1943,10 +1943,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.GistSimple.ForkOfPayload.FilesPayload.AdditionalPropertiesPayload] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2161,10 +2161,10 @@ public enum Components { public init(additionalProperties: [String: Components.Schemas.GistSimple.FilesPayload.AdditionalPropertiesPayload?] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2949,10 +2949,10 @@ public enum Operations { public init(additionalProperties: [String: Operations.GistsCreate.Input.Body.JsonPayload.FilesPayload.AdditionalPropertiesPayload] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2973,8 +2973,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/gists/POST/requestBody/json/public/case2`. case case2(Operations.GistsCreate.Input.Body.JsonPayload.PublicPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -2993,7 +2993,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -4045,10 +4045,10 @@ public enum Operations { public init(additionalProperties: [String: Operations.GistsUpdate.Input.Body.JsonPayload.FilesPayload.AdditionalPropertiesPayload?] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -6411,7 +6411,7 @@ public enum Operations { public struct JsonPayload: Codable, Hashable, Sendable { /// Creates a new `JsonPayload`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } From 9c8e25976da278eb17649ff588a849033a1fc0d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:08:39 +0000 Subject: [PATCH 12/33] Commit via running: make Sources/git --- Sources/git/Types.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/git/Types.swift b/Sources/git/Types.swift index 31ab1051aa..0e801715df 100644 --- a/Sources/git/Types.swift +++ b/Sources/git/Types.swift @@ -697,8 +697,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -723,7 +723,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1937,8 +1937,8 @@ public enum Operations { case ValidationError(Components.Schemas.ValidationError) /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json/case2`. case RepositoryRuleViolationError(Components.Schemas.RepositoryRuleViolationError) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .ValidationError(try .init(from: decoder)) return @@ -1957,7 +1957,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .ValidationError(value): try value.encode(to: encoder) From 9f77a438ce7306f672aa13aa8a7b938c37636a69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:09:24 +0000 Subject: [PATCH 13/33] Commit via running: make Sources/issues --- Sources/issues/Client.swift | 4365 ++++++++++++++++++++++------------- Sources/issues/Types.swift | 4300 ++++++++++++++++++++++++++-------- 2 files changed, 5982 insertions(+), 2683 deletions(-) diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 594e66de24..0a2dab5cc4 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -1466,43 +1466,37 @@ public struct Client: APIProtocol { } ) } - /// List issue events for a repository + /// Pin an issue comment /// - /// Lists events for a repository. + /// You can use the REST API to pin comments on issues. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. - public func issuesListEventsForRepo(_ input: Operations.IssuesListEventsForRepo.Input) async throws -> Operations.IssuesListEventsForRepo.Output { + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. + public func issuesPinComment(_ input: Operations.IssuesPinComment.Input) async throws -> Operations.IssuesPinComment.Output { try await client.send( input: input, - forOperation: Operations.IssuesListEventsForRepo.id, + forOperation: Operations.IssuesPinComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/events", + template: "/repos/{}/{}/issues/comments/{}/pin", parameters: [ input.path.owner, - input.path.repo + input.path.repo, + input.path.commentId ] ) 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 @@ -1512,13 +1506,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListEventsForRepo.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.IssuesListEventsForRepo.Output.Ok.Body + let body: Operations.IssuesPinComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1528,7 +1517,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.IssueEvent].self, + Components.Schemas.IssueComment.self, from: responseBody, transforming: { value in .json(value) @@ -1537,13 +1526,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 422: + return .ok(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1553,7 +1539,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) @@ -1562,54 +1548,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get an issue event - /// - /// Gets a single event by the event id. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. - public func issuesGetEvent(_ input: Operations.IssuesGetEvent.Input) async throws -> Operations.IssuesGetEvent.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesGetEvent.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/events/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.eventId - ] - ) - 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: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetEvent.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1619,7 +1561,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.IssueEvent.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1628,7 +1570,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -1673,9 +1615,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .gone(.init(body: body)) - case 403: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1685,7 +1627,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -1694,7 +1636,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1707,43 +1649,28 @@ public struct Client: APIProtocol { } ) } - /// Get an issue - /// - /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was - /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If - /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API - /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read - /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe - /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. - /// - /// > [!NOTE] - /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// Unpin an issue comment /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// You can use the REST API to unpin comments on issues. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. - public func issuesGet(_ input: Operations.IssuesGet.Input) async throws -> Operations.IssuesGet.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. + public func issuesUnpinComment(_ input: Operations.IssuesUnpinComment.Input) async throws -> Operations.IssuesUnpinComment.Output { try await client.send( input: input, - forOperation: Operations.IssuesGet.id, + forOperation: Operations.IssuesUnpinComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}", + template: "/repos/{}/{}/issues/comments/{}/pin", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber + input.path.commentId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1754,9 +1681,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGet.Output.Ok.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1766,7 +1695,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1775,10 +1704,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 301: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1797,7 +1726,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .movedPermanently(.init(body: body)) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -1842,8 +1771,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .gone(.init(body: body)) - case 304: - return .notModified(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1856,59 +1805,59 @@ public struct Client: APIProtocol { } ) } - /// Update an issue - /// - /// Issue owners and users with push access or Triage role can edit an issue. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// List issue events for a repository /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Lists events for a repository. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. - public func issuesUpdate(_ input: Operations.IssuesUpdate.Input) async throws -> Operations.IssuesUpdate.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. + public func issuesListEventsForRepo(_ input: Operations.IssuesListEventsForRepo.Input) async throws -> Operations.IssuesListEventsForRepo.Output { try await client.send( input: input, - forOperation: Operations.IssuesUpdate.id, + forOperation: Operations.IssuesListEventsForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}", + template: "/repos/{}/{}/issues/events", parameters: [ input.path.owner, - input.path.repo, - input.path.issueNumber + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + 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 ) - 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) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.IssuesListEventsForRepo.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.IssuesUpdate.Output.Ok.Body + let body: Operations.IssuesListEventsForRepo.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1918,7 +1867,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, + [Components.Schemas.IssueEvent].self, from: responseBody, transforming: { value in .json(value) @@ -1927,7 +1876,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -1950,31 +1902,53 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unprocessableContent(.init(body: body)) - case 503: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) - case 403: + ) + } + } + ) + } + /// Get an issue event + /// + /// Gets a single event by the event id. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. + public func issuesGetEvent(_ input: Operations.IssuesGetEvent.Input) async throws -> Operations.IssuesGetEvent.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesGetEvent.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/events/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.eventId + ] + ) + 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.IssuesGetEvent.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1984,7 +1958,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.IssueEvent.self, from: responseBody, transforming: { value in .json(value) @@ -1993,10 +1967,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 301: + return .ok(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2015,10 +1989,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .movedPermanently(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2037,10 +2011,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 410: + return .gone(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2059,7 +2033,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2072,19 +2046,34 @@ public struct Client: APIProtocol { } ) } - /// Add assignees to an issue + /// Get an issue /// - /// Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was + /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API + /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read + /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe + /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)`. - public func issuesAddAssignees(_ input: Operations.IssuesAddAssignees.Input) async throws -> Operations.IssuesAddAssignees.Output { + /// > [!NOTE] + /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. + public func issuesGet(_ input: Operations.IssuesGet.Input) async throws -> Operations.IssuesGet.Output { try await client.send( input: input, - forOperation: Operations.IssuesAddAssignees.id, + forOperation: Operations.IssuesGet.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/assignees", + template: "/repos/{}/{}/issues/{}", parameters: [ input.path.owner, input.path.repo, @@ -2093,31 +2082,20 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddAssignees.Output.Created.Body + let body: Operations.IssuesGet.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2136,7 +2114,75 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 304: + return .notModified(.init()) default: return .undocumented( statusCode: response.status.code, @@ -2149,19 +2195,26 @@ public struct Client: APIProtocol { } ) } - /// Remove assignees from an issue + /// Update an issue /// - /// Removes one or more assignees from an issue. + /// Issue owners and users with push access or Triage role can edit an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)`. - public func issuesRemoveAssignees(_ input: Operations.IssuesRemoveAssignees.Input) async throws -> Operations.IssuesRemoveAssignees.Output { + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. + public func issuesUpdate(_ input: Operations.IssuesUpdate.Input) async throws -> Operations.IssuesUpdate.Output { try await client.send( input: input, - forOperation: Operations.IssuesRemoveAssignees.id, + forOperation: Operations.IssuesUpdate.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/assignees", + template: "/repos/{}/{}/issues/{}", parameters: [ input.path.owner, input.path.repo, @@ -2170,7 +2223,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2194,7 +2247,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesRemoveAssignees.Output.Ok.Body + let body: Operations.IssuesUpdate.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2214,60 +2267,31 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Check if a user can be assigned to a issue - /// - /// Checks if a user has permission to be assigned to a specific issue. - /// - /// If the `assignee` can be assigned to this issue, a `204` status code with no content is returned. - /// - /// Otherwise a `404` status code is returned. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)`. - public func issuesCheckUserCanBeAssignedToIssue(_ input: Operations.IssuesCheckUserCanBeAssignedToIssue.Input) async throws -> Operations.IssuesCheckUserCanBeAssignedToIssue.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesCheckUserCanBeAssignedToIssue.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/assignees/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.issueNumber, - input.path.assignee - ] - ) - 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 204: - return .noContent(.init()) - case 404: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body + let body: Components.Responses.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2277,7 +2301,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2286,89 +2310,32 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + return .serviceUnavailable(.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" + ] ) - } - } - ) - } - /// List issue comments - /// - /// You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. - /// - /// Issue comments are ordered by ascending ID. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/comments`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)`. - public func issuesListComments(_ input: Operations.IssuesListComments.Input) async throws -> Operations.IssuesListComments.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesListComments.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/comments", - parameters: [ - input.path.owner, - input.path.repo, - input.path.issueNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "since", - value: input.query.since - ) - 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.IssuesListComments.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + 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 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListComments.Output.Ok.Body + let body: Components.Responses.MovedPermanently.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2378,7 +2345,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.IssueComment].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2387,10 +2354,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .movedPermanently(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -2447,31 +2411,19 @@ public struct Client: APIProtocol { } ) } - /// Create an issue comment - /// - /// You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). - /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// Add assignees to an issue /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/comments`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. - public func issuesCreateComment(_ input: Operations.IssuesCreateComment.Input) async throws -> Operations.IssuesCreateComment.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)`. + public func issuesAddAssignees(_ input: Operations.IssuesAddAssignees.Input) async throws -> Operations.IssuesAddAssignees.Output { try await client.send( input: input, - forOperation: Operations.IssuesCreateComment.id, + forOperation: Operations.IssuesAddAssignees.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/comments", + template: "/repos/{}/{}/issues/{}/assignees", parameters: [ input.path.owner, input.path.repo, @@ -2489,8 +2441,10 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { + case .none: + body = nil case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( + body = try converter.setOptionalRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -2501,13 +2455,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 201: - let headers: Operations.IssuesCreateComment.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesCreateComment.Output.Created.Body + let body: Operations.IssuesAddAssignees.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2517,7 +2466,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.IssueComment.self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -2526,67 +2475,75 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init( - headers: headers, - 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) - } + return .created(.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 .forbidden(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" + } + } + ) + } + /// Remove assignees from an issue + /// + /// Removes one or more assignees from an issue. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)`. + public func issuesRemoveAssignees(_ input: Operations.IssuesRemoveAssignees.Input) async throws -> Operations.IssuesRemoveAssignees.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesRemoveAssignees.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/assignees", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .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.IssuesRemoveAssignees.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.ValidationError.self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -2595,10 +2552,61 @@ 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, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Check if a user can be assigned to a issue + /// + /// Checks if a user has permission to be assigned to a specific issue. + /// + /// If the `assignee` can be assigned to this issue, a `204` status code with no content is returned. + /// + /// Otherwise a `404` status code is returned. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)`. + public func issuesCheckUserCanBeAssignedToIssue(_ input: Operations.IssuesCheckUserCanBeAssignedToIssue.Input) async throws -> Operations.IssuesCheckUserCanBeAssignedToIssue.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesCheckUserCanBeAssignedToIssue.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/assignees/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber, + input.path.assignee + ] + ) + 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 204: + return .noContent(.init()) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2630,26 +2638,28 @@ public struct Client: APIProtocol { } ) } - /// List dependencies an issue is blocked by + /// List issue comments /// - /// You can use the REST API to list the dependencies an issue is blocked by. + /// You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// Issue comments are ordered by ascending ID. /// - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. - public func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/comments`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)`. + public func issuesListComments(_ input: Operations.IssuesListComments.Input) async throws -> Operations.IssuesListComments.Output { try await client.send( input: input, - forOperation: Operations.IssuesListDependenciesBlockedBy.id, + forOperation: Operations.IssuesListComments.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + template: "/repos/{}/{}/issues/{}/comments", parameters: [ input.path.owner, input.path.repo, @@ -2661,6 +2671,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -2684,13 +2701,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesListComments.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + let body: Operations.IssuesListComments.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2700,7 +2717,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Issue].self, + [Components.Schemas.IssueComment].self, from: responseBody, transforming: { value in .json(value) @@ -2713,28 +2730,6 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 301: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .movedPermanently(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -2791,30 +2786,31 @@ public struct Client: APIProtocol { } ) } - /// Add a dependency an issue is blocked by + /// Create an issue comment /// - /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) - /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. - public func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/comments`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. + public func issuesCreateComment(_ input: Operations.IssuesCreateComment.Input) async throws -> Operations.IssuesCreateComment.Output { try await client.send( input: input, - forOperation: Operations.IssuesAddBlockedByDependency.id, + forOperation: Operations.IssuesCreateComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + template: "/repos/{}/{}/issues/{}/comments", parameters: [ input.path.owner, input.path.repo, @@ -2844,13 +2840,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 201: - let headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesCreateComment.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Location", as: Swift.String.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + let body: Operations.IssuesCreateComment.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2860,7 +2856,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, + Components.Schemas.IssueComment.self, from: responseBody, transforming: { value in .json(value) @@ -2873,28 +2869,6 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 301: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .movedPermanently(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -2995,52 +2969,67 @@ public struct Client: APIProtocol { } ) } - /// Remove dependency an issue is blocked by - /// - /// You can use the REST API to remove a dependency that an issue is blocked by. + /// List dependencies an issue is blocked by /// - /// Removing content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) - /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// You can use the REST API to list the dependencies an issue is blocked by. /// /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. - public func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { try await client.send( input: input, - forOperation: Operations.IssuesRemoveDependencyBlockedBy.id, + forOperation: Operations.IssuesListDependenciesBlockedBy.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/dependencies/blocked_by/{}", + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber, - input.path.issueId + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body + let body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3050,7 +3039,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, + [Components.Schemas.Issue].self, from: responseBody, transforming: { value in .json(value) @@ -3059,7 +3048,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -3082,81 +3074,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .movedPermanently(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -3213,9 +3130,13 @@ public struct Client: APIProtocol { } ) } - /// List dependencies an issue is blocking + /// Add a dependency an issue is blocked by /// - /// You can use the REST API to list the dependencies an issue is blocking. + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). /// /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// @@ -3224,15 +3145,15 @@ public struct Client: APIProtocol { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. - public func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output { try await client.send( input: input, - forOperation: Operations.IssuesListDependenciesBlocking.id, + forOperation: Operations.IssuesAddBlockedByDependency.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/dependencies/blocking", + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", parameters: [ input.path.owner, input.path.repo, @@ -3241,39 +3162,34 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) 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.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + case 201: + let headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self + name: "Location", + as: Swift.String.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + let body: Operations.IssuesAddBlockedByDependency.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3283,7 +3199,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Issue].self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -3292,7 +3208,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( + return .created(.init( headers: headers, body: body )) @@ -3318,9 +3234,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .movedPermanently(.init(body: body)) - case 404: + 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: [ @@ -3339,7 +3255,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .forbidden(.init(body: body)) case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Gone.Body @@ -3362,72 +3278,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .gone(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List issue events - /// - /// Lists all events for an issue. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. - public func issuesListEvents(_ input: Operations.IssuesListEvents.Input) async throws -> Operations.IssuesListEvents.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesListEvents.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/events", - parameters: [ - input.path.owner, - input.path.repo, - input.path.issueNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.IssuesListEvents.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListEvents.Output.Ok.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3437,7 +3290,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.IssueEventForIssue].self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -3446,13 +3299,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 410: + return .unprocessableContent(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3471,7 +3321,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3484,44 +3334,41 @@ public struct Client: APIProtocol { } ) } - /// List labels for an issue + /// Remove dependency an issue is blocked by /// - /// Lists all labels for an issue. + /// You can use the REST API to remove a dependency that an issue is blocked by. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. - public func issuesListLabelsOnIssue(_ input: Operations.IssuesListLabelsOnIssue.Input) async throws -> Operations.IssuesListLabelsOnIssue.Output { + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { try await client.send( input: input, - forOperation: Operations.IssuesListLabelsOnIssue.id, + forOperation: Operations.IssuesRemoveDependencyBlockedBy.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/labels", + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by/{}", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber + input.path.issueNumber, + input.path.issueId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3531,13 +3378,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListLabelsOnIssue.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.IssuesListLabelsOnIssue.Output.Ok.Body + let body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3547,7 +3389,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -3556,10 +3398,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -3582,13 +3421,14 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .movedPermanently(.init(body: body)) - case 404: + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { @@ -3600,90 +3440,21 @@ public struct Client: APIProtocol { .json(value) } ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": + case "application/scim+json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ScimError.self, from: responseBody, transforming: { value in - .json(value) + .applicationScimJson(value) } ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add labels to an issue - /// - /// Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. - public func issuesAddLabels(_ input: Operations.IssuesAddLabels.Input) async throws -> Operations.IssuesAddLabels.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesAddLabels.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/labels", - parameters: [ - input.path.owner, - input.path.repo, - input.path.issueNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .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: + return .badRequest(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddLabels.Output.Ok.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3693,7 +3464,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3702,10 +3473,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 301: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3724,7 +3495,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .movedPermanently(.init(body: body)) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -3769,28 +3540,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3803,19 +3552,26 @@ public struct Client: APIProtocol { } ) } - /// Set labels for an issue + /// List dependencies an issue is blocking /// - /// Removes any previous labels and sets the new labels for an issue. + /// You can use the REST API to list the dependencies an issue is blocking. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. - public func issuesSetLabels(_ input: Operations.IssuesSetLabels.Input) async throws -> Operations.IssuesSetLabels.Output { + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output { try await client.send( input: input, - forOperation: Operations.IssuesSetLabels.id, + forOperation: Operations.IssuesListDependenciesBlocking.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/labels", + template: "/repos/{}/{}/issues/{}/dependencies/blocking", parameters: [ input.path.owner, input.path.repo, @@ -3824,31 +3580,39 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - 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) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesSetLabels.Output.Ok.Body + let body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3858,7 +3622,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + [Components.Schemas.Issue].self, from: responseBody, transforming: { value in .json(value) @@ -3867,7 +3631,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -3934,19 +3701,82 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + } + } + ) + } + /// List issue events + /// + /// Lists all events for an issue. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. + public func issuesListEvents(_ input: Operations.IssuesListEvents.Input) async throws -> Operations.IssuesListEvents.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListEvents.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/events", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.IssuesListEvents.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.IssuesListEvents.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.IssueEventForIssue].self, from: responseBody, transforming: { value in .json(value) @@ -3955,7 +3785,32 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3968,19 +3823,19 @@ public struct Client: APIProtocol { } ) } - /// Remove all labels from an issue + /// List issue field values for an issue /// - /// Removes all labels from an issue. + /// Lists all issue field values for an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. - public func issuesRemoveAllLabels(_ input: Operations.IssuesRemoveAllLabels.Input) async throws -> Operations.IssuesRemoveAllLabels.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. + public func issuesListIssueFieldValuesForIssue(_ input: Operations.IssuesListIssueFieldValuesForIssue.Input) async throws -> Operations.IssuesListIssueFieldValuesForIssue.Output { try await client.send( input: input, - forOperation: Operations.IssuesRemoveAllLabels.id, + forOperation: Operations.IssuesListIssueFieldValuesForIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/labels", + template: "/repos/{}/{}/issues/{}/issue-field-values", parameters: [ input.path.owner, input.path.repo, @@ -3989,9 +3844,23 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "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 @@ -4000,8 +3869,36 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let headers: Operations.IssuesListIssueFieldValuesForIssue.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.IssuesListIssueFieldValuesForIssue.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.IssueFieldValue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -4080,31 +3977,44 @@ public struct Client: APIProtocol { } ) } - /// Remove a label from an issue + /// List labels for an issue /// - /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. + /// Lists all labels for an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. - public func issuesRemoveLabel(_ input: Operations.IssuesRemoveLabel.Input) async throws -> Operations.IssuesRemoveLabel.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. + public func issuesListLabelsOnIssue(_ input: Operations.IssuesListLabelsOnIssue.Input) async throws -> Operations.IssuesListLabelsOnIssue.Output { try await client.send( input: input, - forOperation: Operations.IssuesRemoveLabel.id, + forOperation: Operations.IssuesListLabelsOnIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/labels/{}", + template: "/repos/{}/{}/issues/{}/labels", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber, - input.path.name + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + 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 @@ -4114,8 +4024,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.IssuesListLabelsOnIssue.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.IssuesRemoveLabel.Output.Ok.Body + let body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4134,7 +4049,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -4213,21 +4131,19 @@ public struct Client: APIProtocol { } ) } - /// Lock an issue - /// - /// Users with push access can lock an issue or pull request's conversation. + /// Add labels to an issue /// - /// Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// Adds labels to an issue. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/lock`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)`. - public func issuesLock(_ input: Operations.IssuesLock.Input) async throws -> Operations.IssuesLock.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. + public func issuesAddLabels(_ input: Operations.IssuesAddLabels.Input) async throws -> Operations.IssuesAddLabels.Output { try await client.send( input: input, - forOperation: Operations.IssuesLock.id, + forOperation: Operations.IssuesAddLabels.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/lock", + template: "/repos/{}/{}/issues/{}/labels", parameters: [ input.path.owner, input.path.repo, @@ -4236,7 +4152,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4258,11 +4174,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.IssuesAddLabels.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4272,7 +4186,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.Label].self, from: responseBody, transforming: { value in .json(value) @@ -4281,10 +4195,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 410: + return .ok(.init(body: body)) + case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.MovedPermanently.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4303,7 +4217,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .movedPermanently(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4326,6 +4240,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -4360,19 +4296,19 @@ public struct Client: APIProtocol { } ) } - /// Unlock an issue + /// Set labels for an issue /// - /// Users with push access can unlock an issue's conversation. + /// Removes any previous labels and sets the new labels for an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. - public func issuesUnlock(_ input: Operations.IssuesUnlock.Input) async throws -> Operations.IssuesUnlock.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesUnlock.id, + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. + public func issuesSetLabels(_ input: Operations.IssuesSetLabels.Input) async throws -> Operations.IssuesSetLabels.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesSetLabels.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/lock", + template: "/repos/{}/{}/issues/{}/labels", parameters: [ input.path.owner, input.path.repo, @@ -4381,22 +4317,53 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.IssuesSetLabels.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.Label].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4415,7 +4382,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .movedPermanently(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4438,6 +4405,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.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, @@ -4450,26 +4461,19 @@ public struct Client: APIProtocol { } ) } - /// Get parent issue - /// - /// You can use the REST API to get the parent issue of a sub-issue. - /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// Remove all labels from an issue /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Removes all labels from an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. - public func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. + public func issuesRemoveAllLabels(_ input: Operations.IssuesRemoveAllLabels.Input) async throws -> Operations.IssuesRemoveAllLabels.Output { try await client.send( input: input, - forOperation: Operations.IssuesGetParent.id, + forOperation: Operations.IssuesRemoveAllLabels.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/parent", + template: "/repos/{}/{}/issues/{}/labels", parameters: [ input.path.owner, input.path.repo, @@ -4478,7 +4482,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4489,28 +4493,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetParent.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -4589,31 +4573,24 @@ public struct Client: APIProtocol { } ) } - /// Remove sub-issue + /// Remove a label from an issue /// - /// You can use the REST API to remove a sub-issue from an issue. - /// Removing content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. - public func issuesRemoveSubIssue(_ input: Operations.IssuesRemoveSubIssue.Input) async throws -> Operations.IssuesRemoveSubIssue.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. + public func issuesRemoveLabel(_ input: Operations.IssuesRemoveLabel.Input) async throws -> Operations.IssuesRemoveLabel.Output { try await client.send( input: input, - forOperation: Operations.IssuesRemoveSubIssue.id, + forOperation: Operations.IssuesRemoveLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issue", + template: "/repos/{}/{}/issues/{}/labels/{}", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber + input.path.issueNumber, + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4625,27 +4602,13 @@ public struct Client: APIProtocol { in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesRemoveSubIssue.Output.Ok.Body + let body: Operations.IssuesRemoveLabel.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4655,7 +4618,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, + [Components.Schemas.Label].self, from: responseBody, transforming: { value in .json(value) @@ -4664,18 +4627,14 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 400: + return .ok(.init(body: body)) + case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body + let body: Components.Responses.MovedPermanently.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json", - "application/scim+json" + "application/json" ] ) switch chosenContentType { @@ -4687,21 +4646,35 @@ public struct Client: APIProtocol { .json(value) } ) - case "application/scim+json": + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in - .applicationScimJson(value) + .json(value) } ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .badRequest(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4720,7 +4693,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4733,26 +4706,21 @@ public struct Client: APIProtocol { } ) } - /// List sub-issues - /// - /// You can use the REST API to list the sub-issues on an issue. + /// Lock an issue /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// Users with push access can lock an issue or pull request's conversation. /// - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. - public func issuesListSubIssues(_ input: Operations.IssuesListSubIssues.Input) async throws -> Operations.IssuesListSubIssues.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/lock`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)`. + public func issuesLock(_ input: Operations.IssuesLock.Input) async throws -> Operations.IssuesLock.Output { try await client.send( input: input, - forOperation: Operations.IssuesListSubIssues.id, + forOperation: Operations.IssuesLock.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issues", + template: "/repos/{}/{}/issues/{}/lock", parameters: [ input.path.owner, input.path.repo, @@ -4761,39 +4729,33 @@ public struct Client: APIProtocol { ) 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 .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 headers: Operations.IssuesListSubIssues.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.IssuesListSubIssues.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4803,7 +4765,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Issue].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -4812,10 +4774,29 @@ 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 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4838,9 +4819,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 410: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4850,7 +4831,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -4859,7 +4840,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4872,30 +4853,19 @@ public struct Client: APIProtocol { } ) } - /// Add sub-issue - /// - /// You can use the REST API to add sub-issues to issues. - /// - /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// Unlock an issue /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Users with push access can unlock an issue's conversation. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. - public func issuesAddSubIssue(_ input: Operations.IssuesAddSubIssue.Input) async throws -> Operations.IssuesAddSubIssue.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. + public func issuesUnlock(_ input: Operations.IssuesUnlock.Input) async throws -> Operations.IssuesUnlock.Output { try await client.send( input: input, - forOperation: Operations.IssuesAddSubIssue.id, + forOperation: Operations.IssuesUnlock.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issues", + template: "/repos/{}/{}/issues/{}/lock", parameters: [ input.path.owner, input.path.repo, @@ -4904,56 +4874,19 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddSubIssue.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Issue.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init( - headers: headers, - body: body - )) + case 204: + return .noContent(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -4976,50 +4909,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -5054,19 +4943,26 @@ public struct Client: APIProtocol { } ) } - /// Reprioritize sub-issue + /// Get parent issue /// - /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// You can use the REST API to get the parent issue of a sub-issue. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. - public func issuesReprioritizeSubIssue(_ input: Operations.IssuesReprioritizeSubIssue.Input) async throws -> Operations.IssuesReprioritizeSubIssue.Output { + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output { try await client.send( input: input, - forOperation: Operations.IssuesReprioritizeSubIssue.id, + forOperation: Operations.IssuesGetParent.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issues/priority", + template: "/repos/{}/{}/issues/{}/parent", parameters: [ input.path.owner, input.path.repo, @@ -5075,29 +4971,20 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body + let body: Operations.IssuesGetParent.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5117,9 +5004,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 403: + case 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.MovedPermanently.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5138,7 +5025,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .movedPermanently(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -5161,9 +5048,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: + case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5173,7 +5060,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5182,54 +5069,40 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 503: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) } } ) } - /// List timeline events for an issue + /// Remove sub-issue /// - /// List all timeline events for an issue. + /// You can use the REST API to remove a sub-issue from an issue. + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/timeline`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)`. - public func issuesListEventsForTimeline(_ input: Operations.IssuesListEventsForTimeline.Input) async throws -> Operations.IssuesListEventsForTimeline.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + public func issuesRemoveSubIssue(_ input: Operations.IssuesRemoveSubIssue.Input) async throws -> Operations.IssuesRemoveSubIssue.Output { try await client.send( input: input, - forOperation: Operations.IssuesListEventsForTimeline.id, + forOperation: Operations.IssuesRemoveSubIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/timeline", + template: "/repos/{}/{}/issues/{}/sub_issue", parameters: [ input.path.owner, input.path.repo, @@ -5238,39 +5111,34 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - 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.IssuesListEventsForTimeline.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self + name: "Location", + as: Swift.String.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListEventsForTimeline.Output.Ok.Body + let body: Operations.IssuesRemoveSubIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5280,7 +5148,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TimelineIssueEvents].self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -5293,13 +5161,14 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 404: + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { @@ -5311,13 +5180,21 @@ public struct Client: APIProtocol { .json(value) } ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 410: + return .badRequest(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5336,7 +5213,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5349,22 +5226,30 @@ public struct Client: APIProtocol { } ) } - /// List labels for a repository + /// List sub-issues /// - /// Lists all labels for a repository. + /// You can use the REST API to list the sub-issues on an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)`. - public func issuesListLabelsForRepo(_ input: Operations.IssuesListLabelsForRepo.Input) async throws -> Operations.IssuesListLabelsForRepo.Output { + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + public func issuesListSubIssues(_ input: Operations.IssuesListSubIssues.Input) async throws -> Operations.IssuesListSubIssues.Output { try await client.send( input: input, - forOperation: Operations.IssuesListLabelsForRepo.id, + forOperation: Operations.IssuesListSubIssues.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/labels", + template: "/repos/{}/{}/issues/{}/sub_issues", parameters: [ input.path.owner, - input.path.repo + input.path.repo, + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5395,13 +5280,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesListSubIssues.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.IssuesListLabelsForRepo.Output.Ok.Body + let body: Operations.IssuesListSubIssues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5411,7 +5296,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + [Components.Schemas.Issue].self, from: responseBody, transforming: { value in .json(value) @@ -5446,6 +5331,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5458,22 +5365,34 @@ public struct Client: APIProtocol { } ) } - /// Create a label + /// Add sub-issue /// - /// Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). + /// You can use the REST API to add sub-issues to issues. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)`. - public func issuesCreateLabel(_ input: Operations.IssuesCreateLabel.Input) async throws -> Operations.IssuesCreateLabel.Output { + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + public func issuesAddSubIssue(_ input: Operations.IssuesAddSubIssue.Input) async throws -> Operations.IssuesAddSubIssue.Output { try await client.send( input: input, - forOperation: Operations.IssuesCreateLabel.id, + forOperation: Operations.IssuesAddSubIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/labels", + template: "/repos/{}/{}/issues/{}/sub_issues", parameters: [ input.path.owner, - input.path.repo + input.path.repo, + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5499,13 +5418,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 201: - let headers: Operations.IssuesCreateLabel.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Location", as: Swift.String.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesCreateLabel.Output.Created.Body + let body: Operations.IssuesAddSubIssue.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5515,7 +5434,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Label.self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -5528,9 +5447,9 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 422: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5540,7 +5459,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) @@ -5549,10 +5468,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 404: + return .forbidden(.init(body: body)) + case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5571,54 +5490,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a label - /// - /// Gets a label using the given name. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)`. - public func issuesGetLabel(_ input: Operations.IssuesGetLabel.Input) async throws -> Operations.IssuesGetLabel.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesGetLabel.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/labels/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.name - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + return .gone(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetLabel.Output.Ok.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5628,7 +5503,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Label.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -5637,7 +5512,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -5672,23 +5547,23 @@ public struct Client: APIProtocol { } ) } - /// Update a label + /// Reprioritize sub-issue /// - /// Updates a label using the given label name. + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)`. - public func issuesUpdateLabel(_ input: Operations.IssuesUpdateLabel.Input) async throws -> Operations.IssuesUpdateLabel.Output { + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + public func issuesReprioritizeSubIssue(_ input: Operations.IssuesReprioritizeSubIssue.Input) async throws -> Operations.IssuesReprioritizeSubIssue.Output { try await client.send( input: input, - forOperation: Operations.IssuesUpdateLabel.id, + forOperation: Operations.IssuesReprioritizeSubIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/labels/{}", + template: "/repos/{}/{}/issues/{}/sub_issues/priority", parameters: [ input.path.owner, input.path.repo, - input.path.name + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5702,10 +5577,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -5717,7 +5590,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesUpdateLabel.Output.Ok.Body + let body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5727,7 +5600,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Label.self, + Components.Schemas.Issue.self, from: responseBody, transforming: { value in .json(value) @@ -5737,48 +5610,94 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + 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" + ] ) - } - } - ) - } - /// Delete a label - /// - /// Deletes a label using the given label name. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/delete(issues/delete-label)`. - public func issuesDeleteLabel(_ input: Operations.IssuesDeleteLabel.Input) async throws -> Operations.IssuesDeleteLabel.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesDeleteLabel.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/labels/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.name - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5791,22 +5710,23 @@ public struct Client: APIProtocol { } ) } - /// List milestones + /// List timeline events for an issue /// - /// Lists milestones for a repository. + /// List all timeline events for an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)`. - public func issuesListMilestones(_ input: Operations.IssuesListMilestones.Input) async throws -> Operations.IssuesListMilestones.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/timeline`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)`. + public func issuesListEventsForTimeline(_ input: Operations.IssuesListEventsForTimeline.Input) async throws -> Operations.IssuesListEventsForTimeline.Output { try await client.send( input: input, - forOperation: Operations.IssuesListMilestones.id, + forOperation: Operations.IssuesListEventsForTimeline.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones", + template: "/repos/{}/{}/issues/{}/timeline", parameters: [ input.path.owner, - input.path.repo + input.path.repo, + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5814,27 +5734,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "state", - value: input.query.state - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -5858,13 +5757,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListMilestones.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.IssuesListEventsForTimeline.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.IssuesListMilestones.Output.Ok.Body + let body: Operations.IssuesListEventsForTimeline.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5874,7 +5773,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Milestone].self, + [Components.Schemas.TimelineIssueEvents].self, from: responseBody, transforming: { value in .json(value) @@ -5909,6 +5808,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5921,19 +5842,19 @@ public struct Client: APIProtocol { } ) } - /// Create a milestone + /// List labels for a repository /// - /// Creates a milestone. + /// Lists all labels for a repository. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/milestones`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)`. - public func issuesCreateMilestone(_ input: Operations.IssuesCreateMilestone.Input) async throws -> Operations.IssuesCreateMilestone.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)`. + public func issuesListLabelsForRepo(_ input: Operations.IssuesListLabelsForRepo.Input) async throws -> Operations.IssuesListLabelsForRepo.Output { try await client.send( input: input, - forOperation: Operations.IssuesCreateMilestone.id, + forOperation: Operations.IssuesListLabelsForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones", + template: "/repos/{}/{}/labels", parameters: [ input.path.owner, input.path.repo @@ -5941,34 +5862,143 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + 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 ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let headers: Operations.IssuesCreateMilestone.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + case 200: + let headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, - name: "Location", + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesListLabelsForRepo.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.Label].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a label + /// + /// Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)`. + public func issuesCreateLabel(_ input: Operations.IssuesCreateLabel.Input) async throws -> Operations.IssuesCreateLabel.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesCreateLabel.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/labels", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let headers: Operations.IssuesCreateLabel.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", as: Swift.String.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesCreateMilestone.Output.Created.Body + let body: Operations.IssuesCreateLabel.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5978,7 +6008,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Milestone.self, + Components.Schemas.Label.self, from: responseBody, transforming: { value in .json(value) @@ -5991,9 +6021,1160 @@ public struct Client: APIProtocol { headers: headers, body: body )) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a label + /// + /// Gets a label using the given name. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)`. + public func issuesGetLabel(_ input: Operations.IssuesGetLabel.Input) async throws -> Operations.IssuesGetLabel.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesGetLabel.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/labels/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesGetLabel.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.Label.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a label + /// + /// Updates a label using the given label name. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)`. + public func issuesUpdateLabel(_ input: Operations.IssuesUpdateLabel.Input) async throws -> Operations.IssuesUpdateLabel.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesUpdateLabel.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/labels/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .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.IssuesUpdateLabel.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.Label.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a label + /// + /// Deletes a label using the given label name. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/delete(issues/delete-label)`. + public func issuesDeleteLabel(_ input: Operations.IssuesDeleteLabel.Input) async throws -> Operations.IssuesDeleteLabel.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesDeleteLabel.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/labels/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List milestones + /// + /// Lists milestones for a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)`. + public func issuesListMilestones(_ input: Operations.IssuesListMilestones.Input) async throws -> Operations.IssuesListMilestones.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListMilestones.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "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.IssuesListMilestones.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.IssuesListMilestones.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.Milestone].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a milestone + /// + /// Creates a milestone. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/milestones`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)`. + public func issuesCreateMilestone(_ input: Operations.IssuesCreateMilestone.Input) async throws -> Operations.IssuesCreateMilestone.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesCreateMilestone.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let headers: Operations.IssuesCreateMilestone.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesCreateMilestone.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.Milestone.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a milestone + /// + /// Gets a milestone using the given milestone number. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)`. + public func issuesGetMilestone(_ input: Operations.IssuesGetMilestone.Input) async throws -> Operations.IssuesGetMilestone.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesGetMilestone.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.milestoneNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesGetMilestone.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.Milestone.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a milestone + /// + /// + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/milestones/{milestone_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)`. + public func issuesUpdateMilestone(_ input: Operations.IssuesUpdateMilestone.Input) async throws -> Operations.IssuesUpdateMilestone.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesUpdateMilestone.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.milestoneNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesUpdateMilestone.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.Milestone.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a milestone + /// + /// Deletes a milestone using the given milestone number. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/milestones/{milestone_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)`. + public func issuesDeleteMilestone(_ input: Operations.IssuesDeleteMilestone.Input) async throws -> Operations.IssuesDeleteMilestone.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesDeleteMilestone.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.milestoneNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List labels for issues in a milestone + /// + /// Lists labels for issues in a milestone. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)`. + public func issuesListLabelsForMilestone(_ input: Operations.IssuesListLabelsForMilestone.Input) async throws -> Operations.IssuesListLabelsForMilestone.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListLabelsForMilestone.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/milestones/{}/labels", + parameters: [ + input.path.owner, + input.path.repo, + input.path.milestoneNumber + ] + ) + 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.IssuesListLabelsForMilestone.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.IssuesListLabelsForMilestone.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.Label].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add issue field values to an issue + /// + /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// Adding an empty array will clear all existing field values for the issue. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. + public func issuesAddIssueFieldValues(_ input: Operations.IssuesAddIssueFieldValues.Input) async throws -> Operations.IssuesAddIssueFieldValues.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesAddIssueFieldValues.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repositories/{}/issues/{}/issue-field-values", + parameters: [ + input.path.repositoryId, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesAddIssueFieldValues.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.IssueFieldValue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set issue field values for an issue + /// + /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. + /// + /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `PUT /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. + public func issuesSetIssueFieldValues(_ input: Operations.IssuesSetIssueFieldValues.Input) async throws -> Operations.IssuesSetIssueFieldValues.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesSetIssueFieldValues.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repositories/{}/issues/{}/issue-field-values", + parameters: [ + input.path.repositoryId, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesSetIssueFieldValues.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.IssueFieldValue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6012,10 +7193,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: [ @@ -6025,7 +7206,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) @@ -6034,54 +7215,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a milestone - /// - /// Gets a milestone using the given milestone number. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)`. - public func issuesGetMilestone(_ input: Operations.IssuesGetMilestone.Input) async throws -> Operations.IssuesGetMilestone.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesGetMilestone.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.milestoneNumber - ] - ) - 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: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetMilestone.Output.Ok.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6091,7 +7228,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Milestone.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -6100,10 +7237,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: + return .unprocessableContent(.init(body: body)) + case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6113,7 +7250,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -6122,7 +7259,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6135,52 +7272,50 @@ public struct Client: APIProtocol { } ) } - /// Update a milestone + /// Delete an issue field value from an issue /// + /// Remove a specific custom field value from an issue. /// + /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)`. - public func issuesUpdateMilestone(_ input: Operations.IssuesUpdateMilestone.Input) async throws -> Operations.IssuesUpdateMilestone.Output { + /// If the specified field does not have a value set on the issue, this operation will return a `404` error. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `DELETE /repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. + public func issuesDeleteIssueFieldValue(_ input: Operations.IssuesDeleteIssueFieldValue.Input) async throws -> Operations.IssuesDeleteIssueFieldValue.Output { try await client.send( input: input, - forOperation: Operations.IssuesUpdateMilestone.id, + forOperation: Operations.IssuesDeleteIssueFieldValue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", + template: "/repositories/{}/issues/{}/issue-field-values/{}", parameters: [ - input.path.owner, - input.path.repo, - input.path.milestoneNumber + input.path.repositoryId, + input.path.issueNumber, + input.path.issueFieldId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, 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.IssuesUpdateMilestone.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6190,7 +7325,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Milestone.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -6199,53 +7334,7 @@ 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 - ) - ) - } - } - ) - } - /// Delete a milestone - /// - /// Deletes a milestone using the given milestone number. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)`. - public func issuesDeleteMilestone(_ input: Operations.IssuesDeleteMilestone.Input) async throws -> Operations.IssuesDeleteMilestone.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesDeleteMilestone.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.milestoneNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -6268,72 +7357,31 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + 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" + ] ) - } - } - ) - } - /// List labels for issues in a milestone - /// - /// Lists labels for issues in a milestone. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)`. - public func issuesListLabelsForMilestone(_ input: Operations.IssuesListLabelsForMilestone.Input) async throws -> Operations.IssuesListLabelsForMilestone.Output { - try await client.send( - input: input, - forOperation: Operations.IssuesListLabelsForMilestone.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}/labels", - parameters: [ - input.path.owner, - input.path.repo, - input.path.milestoneNumber - ] - ) - 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.IssuesListLabelsForMilestone.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body + let body: Components.Responses.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6343,7 +7391,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -6352,10 +7400,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 0f5a480e99..07bb63916b 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -150,6 +150,27 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)`. func issuesDeleteComment(_ input: Operations.IssuesDeleteComment.Input) async throws -> Operations.IssuesDeleteComment.Output + /// Pin an issue comment + /// + /// You can use the REST API to pin comments on issues. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. + func issuesPinComment(_ input: Operations.IssuesPinComment.Input) async throws -> Operations.IssuesPinComment.Output + /// Unpin an issue comment + /// + /// You can use the REST API to unpin comments on issues. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. + func issuesUnpinComment(_ input: Operations.IssuesUnpinComment.Input) async throws -> Operations.IssuesUnpinComment.Output /// List issue events for a repository /// /// Lists events for a repository. @@ -330,6 +351,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. func issuesListEvents(_ input: Operations.IssuesListEvents.Input) async throws -> Operations.IssuesListEvents.Output + /// List issue field values for an issue + /// + /// Lists all issue field values for an issue. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. + func issuesListIssueFieldValuesForIssue(_ input: Operations.IssuesListIssueFieldValuesForIssue.Input) async throws -> Operations.IssuesListIssueFieldValuesForIssue.Output /// List labels for an issue /// /// Lists all labels for an issue. @@ -339,7 +367,7 @@ public protocol APIProtocol: Sendable { func issuesListLabelsOnIssue(_ input: Operations.IssuesListLabelsOnIssue.Input) async throws -> Operations.IssuesListLabelsOnIssue.Output /// Add labels to an issue /// - /// Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. + /// Adds labels to an issue. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. @@ -533,6 +561,59 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)`. func issuesListLabelsForMilestone(_ input: Operations.IssuesListLabelsForMilestone.Input) async throws -> Operations.IssuesListLabelsForMilestone.Output + /// Add issue field values to an issue + /// + /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// Adding an empty array will clear all existing field values for the issue. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. + func issuesAddIssueFieldValues(_ input: Operations.IssuesAddIssueFieldValues.Input) async throws -> Operations.IssuesAddIssueFieldValues.Output + /// Set issue field values for an issue + /// + /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. + /// + /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `PUT /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. + func issuesSetIssueFieldValues(_ input: Operations.IssuesSetIssueFieldValues.Input) async throws -> Operations.IssuesSetIssueFieldValues.Output + /// Delete an issue field value from an issue + /// + /// Remove a specific custom field value from an issue. + /// + /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// If the specified field does not have a value set on the issue, this operation will return a `404` error. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `DELETE /repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. + func issuesDeleteIssueFieldValue(_ input: Operations.IssuesDeleteIssueFieldValue.Input) async throws -> Operations.IssuesDeleteIssueFieldValue.Output /// List user account issues assigned to the authenticated user /// /// List issues across owned and member repositories assigned to the authenticated user. @@ -779,6 +860,43 @@ extension APIProtocol { public func issuesDeleteComment(path: Operations.IssuesDeleteComment.Input.Path) async throws -> Operations.IssuesDeleteComment.Output { try await issuesDeleteComment(Operations.IssuesDeleteComment.Input(path: path)) } + /// Pin an issue comment + /// + /// You can use the REST API to pin comments on issues. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. + public func issuesPinComment( + path: Operations.IssuesPinComment.Input.Path, + headers: Operations.IssuesPinComment.Input.Headers = .init() + ) async throws -> Operations.IssuesPinComment.Output { + try await issuesPinComment(Operations.IssuesPinComment.Input( + path: path, + headers: headers + )) + } + /// Unpin an issue comment + /// + /// You can use the REST API to unpin comments on issues. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. + public func issuesUnpinComment( + path: Operations.IssuesUnpinComment.Input.Path, + headers: Operations.IssuesUnpinComment.Input.Headers = .init() + ) async throws -> Operations.IssuesUnpinComment.Output { + try await issuesUnpinComment(Operations.IssuesUnpinComment.Input( + path: path, + headers: headers + )) + } /// List issue events for a repository /// /// Lists events for a repository. @@ -1091,6 +1209,23 @@ extension APIProtocol { headers: headers )) } + /// List issue field values for an issue + /// + /// Lists all issue field values for an issue. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. + public func issuesListIssueFieldValuesForIssue( + path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path, + query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query = .init(), + headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers = .init() + ) async throws -> Operations.IssuesListIssueFieldValuesForIssue.Output { + try await issuesListIssueFieldValuesForIssue(Operations.IssuesListIssueFieldValuesForIssue.Input( + path: path, + query: query, + headers: headers + )) + } /// List labels for an issue /// /// Lists all labels for an issue. @@ -1110,7 +1245,7 @@ extension APIProtocol { } /// Add labels to an issue /// - /// Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. + /// Adds labels to an issue. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. @@ -1512,6 +1647,87 @@ extension APIProtocol { headers: headers )) } + /// Add issue field values to an issue + /// + /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// Adding an empty array will clear all existing field values for the issue. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. + public func issuesAddIssueFieldValues( + path: Operations.IssuesAddIssueFieldValues.Input.Path, + headers: Operations.IssuesAddIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesAddIssueFieldValues.Input.Body + ) async throws -> Operations.IssuesAddIssueFieldValues.Output { + try await issuesAddIssueFieldValues(Operations.IssuesAddIssueFieldValues.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set issue field values for an issue + /// + /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. + /// + /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `PUT /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. + public func issuesSetIssueFieldValues( + path: Operations.IssuesSetIssueFieldValues.Input.Path, + headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesSetIssueFieldValues.Input.Body + ) async throws -> Operations.IssuesSetIssueFieldValues.Output { + try await issuesSetIssueFieldValues(Operations.IssuesSetIssueFieldValues.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an issue field value from an issue + /// + /// Remove a specific custom field value from an issue. + /// + /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// If the specified field does not have a value set on the issue, this operation will return a `404` error. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `DELETE /repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. + public func issuesDeleteIssueFieldValue( + path: Operations.IssuesDeleteIssueFieldValue.Input.Path, + headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers = .init() + ) async throws -> Operations.IssuesDeleteIssueFieldValue.Output { + try await issuesDeleteIssueFieldValue(Operations.IssuesDeleteIssueFieldValue.Input( + path: path, + headers: headers + )) + } /// List user account issues assigned to the authenticated user /// /// List issues across owned and member repositories assigned to the authenticated user. @@ -1880,8 +2096,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -1900,7 +2116,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -1972,7 +2188,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -2002,7 +2218,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -2181,8 +2397,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -2207,7 +2423,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -2680,6 +2896,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2925,6 +3160,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -3022,6 +3260,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -3119,6 +3360,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3217,6 +3461,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3245,6 +3492,73 @@ public enum Components { case codeSearchIndexStatus = "code_search_index_status" } } + /// Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + /// + /// - Remark: Generated from `#/components/schemas/label`. + public struct Label: Codable, Hashable, Sendable { + /// Unique identifier for the label. + /// + /// - Remark: Generated from `#/components/schemas/label/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/label/node_id`. + public var nodeId: Swift.String + /// URL for the label + /// + /// - Remark: Generated from `#/components/schemas/label/url`. + public var url: Swift.String + /// The name of the label. + /// + /// - Remark: Generated from `#/components/schemas/label/name`. + public var name: Swift.String + /// Optional description of the label, such as its purpose. + /// + /// - Remark: Generated from `#/components/schemas/label/description`. + public var description: Swift.String? + /// 6-character hex code, without the leading #, identifying the color + /// + /// - Remark: Generated from `#/components/schemas/label/color`. + public var color: Swift.String + /// Whether this label comes by default in a new repository. + /// + /// - Remark: Generated from `#/components/schemas/label/default`. + public var _default: Swift.Bool + /// Creates a new `Label`. + /// + /// - Parameters: + /// - id: Unique identifier for the label. + /// - nodeId: + /// - url: URL for the label + /// - name: The name of the label. + /// - description: Optional description of the label, such as its purpose. + /// - color: 6-character hex code, without the leading #, identifying the color + /// - _default: Whether this label comes by default in a new repository. + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } /// A collection of related issues and pull requests. /// /// - Remark: Generated from `#/components/schemas/nullable-milestone`. @@ -3479,8 +3793,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -3499,7 +3813,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -3571,7 +3885,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -3601,7 +3915,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -3816,93 +4130,227 @@ public enum Components { case percentCompleted = "percent_completed" } } - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. - public struct IssueDependenciesSummary: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. - public var blockedBy: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. - public var blocking: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. - public var totalBlockedBy: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. - public var totalBlocking: Swift.Int - /// Creates a new `IssueDependenciesSummary`. + /// Context around who pinned an issue comment and when it was pinned. + /// + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment`. + public struct NullablePinnedIssueComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_at`. + public var pinnedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_by`. + public var pinnedBy: Components.Schemas.NullableSimpleUser? + /// Creates a new `NullablePinnedIssueComment`. /// /// - Parameters: - /// - blockedBy: - /// - blocking: - /// - totalBlockedBy: - /// - totalBlocking: + /// - pinnedAt: + /// - pinnedBy: public init( - blockedBy: Swift.Int, - blocking: Swift.Int, - totalBlockedBy: Swift.Int, - totalBlocking: Swift.Int + pinnedAt: Foundation.Date, + pinnedBy: Components.Schemas.NullableSimpleUser? = nil ) { - self.blockedBy = blockedBy - self.blocking = blocking - self.totalBlockedBy = totalBlockedBy - self.totalBlocking = totalBlocking + self.pinnedAt = pinnedAt + self.pinnedBy = pinnedBy } public enum CodingKeys: String, CodingKey { - case blockedBy = "blocked_by" - case blocking - case totalBlockedBy = "total_blocked_by" - case totalBlocking = "total_blocking" + case pinnedAt = "pinned_at" + case pinnedBy = "pinned_by" } } - /// A value assigned to an issue field + /// Comments provide a way for people to collaborate on an issue. /// - /// - Remark: Generated from `#/components/schemas/issue-field-value`. - public struct IssueFieldValue: Codable, Hashable, Sendable { - /// Unique identifier for the issue field. + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment`. + public struct NullableIssueComment: Codable, Hashable, Sendable { + /// Unique identifier of the issue comment /// - /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. - public var issueFieldId: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/node_id`. public var nodeId: Swift.String - /// The data type of the issue field + /// URL for the issue comment /// - /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. - @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case text = "text" - case singleSelect = "single_select" - case number = "number" - case date = "date" - } - /// The data type of the issue field + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/url`. + public var url: Swift.String + /// Contents of the issue comment /// - /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. - public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload - /// The value of the issue field + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? + /// Creates a new `NullableIssueComment`. /// - /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. - public struct ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. - public var value1: Swift.String? - /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. - public var value2: Swift.Double? - /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. - public var value3: Swift.Int? - /// Creates a new `ValuePayload`. - /// - /// - Parameters: - /// - value1: - /// - value2: - /// - value3: - public init( - value1: Swift.String? = nil, - value2: Swift.Double? = nil, - value3: Swift.Int? = nil - ) { - self.value1 = value1 - self.value2 = value2 - self.value3 = value3 - } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self.value1 = try decoder.decodeFromSingleValueContainer() + /// - Parameters: + /// - id: Unique identifier of the issue comment + /// - nodeId: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment + /// - bodyText: + /// - bodyHtml: + /// - htmlUrl: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - issueUrl: + /// - authorAssociation: + /// - performedViaGithubApp: + /// - reactions: + /// - pin: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + bodyText: Swift.String? = nil, + bodyHtml: Swift.String? = nil, + htmlUrl: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + issueUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.body = body + self.bodyText = bodyText + self.bodyHtml = bodyHtml + self.htmlUrl = htmlUrl + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + self.issueUrl = issueUrl + self.authorAssociation = authorAssociation + self.performedViaGithubApp = performedViaGithubApp + self.reactions = reactions + self.pin = pin + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case body + case bodyText = "body_text" + case bodyHtml = "body_html" + case htmlUrl = "html_url" + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + case issueUrl = "issue_url" + case authorAssociation = "author_association" + case performedViaGithubApp = "performed_via_github_app" + case reactions + case pin + } + } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() } catch { errors.append(error) } @@ -3927,7 +4375,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2, @@ -4121,8 +4569,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. case case2(Components.Schemas.Issue.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -4141,7 +4589,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -4245,6 +4693,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pinned_comment`. + public var pinnedComment: Components.Schemas.NullableIssueComment? /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. @@ -4289,6 +4739,7 @@ public enum Components { /// - reactions: /// - subIssuesSummary: /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - pinnedComment: /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -4329,6 +4780,7 @@ public enum Components { reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, parentIssueUrl: Swift.String? = nil, + pinnedComment: Components.Schemas.NullableIssueComment? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -4369,6 +4821,7 @@ public enum Components { self.reactions = reactions self.subIssuesSummary = subIssuesSummary self.parentIssueUrl = parentIssueUrl + self.pinnedComment = pinnedComment self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -4410,6 +4863,7 @@ public enum Components { case reactions case subIssuesSummary = "sub_issues_summary" case parentIssueUrl = "parent_issue_url" + case pinnedComment = "pinned_comment" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -4447,11 +4901,13 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue-comment/issue_url`. public var issueUrl: Swift.String /// - Remark: Generated from `#/components/schemas/issue-comment/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue-comment/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue-comment/reactions`. public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? /// Creates a new `IssueComment`. /// /// - Parameters: @@ -4469,6 +4925,7 @@ public enum Components { /// - authorAssociation: /// - performedViaGithubApp: /// - reactions: + /// - pin: public init( id: Swift.Int64, nodeId: Swift.String, @@ -4481,9 +4938,10 @@ public enum Components { createdAt: Foundation.Date, updatedAt: Foundation.Date, issueUrl: Swift.String, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - reactions: Components.Schemas.ReactionRollup? = nil + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil ) { self.id = id self.nodeId = nodeId @@ -4499,6 +4957,7 @@ public enum Components { self.authorAssociation = authorAssociation self.performedViaGithubApp = performedViaGithubApp self.reactions = reactions + self.pin = pin } public enum CodingKeys: String, CodingKey { case id @@ -4515,6 +4974,7 @@ public enum Components { case authorAssociation = "author_association" case performedViaGithubApp = "performed_via_github_app" case reactions + case pin } } /// Groups of organization members that gives permissions on specified repositories. @@ -5033,8 +5493,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/nullable-issue/LabelsPayload/case2`. case case2(Components.Schemas.NullableIssue.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -5053,7 +5513,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -5157,6 +5617,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-issue/parent_issue_url`. public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue/pinned_comment`. + public var pinnedComment: Components.Schemas.NullableIssueComment? /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_field_values`. @@ -5201,6 +5663,7 @@ public enum Components { /// - reactions: /// - subIssuesSummary: /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - pinnedComment: /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -5241,6 +5704,7 @@ public enum Components { reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, parentIssueUrl: Swift.String? = nil, + pinnedComment: Components.Schemas.NullableIssueComment? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -5281,6 +5745,7 @@ public enum Components { self.reactions = reactions self.subIssuesSummary = subIssuesSummary self.parentIssueUrl = parentIssueUrl + self.pinnedComment = pinnedComment self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -5322,6 +5787,7 @@ public enum Components { case reactions case subIssuesSummary = "sub_issues_summary" case parentIssueUrl = "parent_issue_url" + case pinnedComment = "pinned_comment" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -7160,8 +7626,8 @@ public enum Components { self.value14 = value14 self.value15 = value15 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -7260,7 +7726,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) try self.value3?.encode(to: encoder) @@ -7278,73 +7744,6 @@ public enum Components { try self.value15?.encode(to: encoder) } } - /// Color-coded labels help you categorize and filter your issues (just like labels in Gmail). - /// - /// - Remark: Generated from `#/components/schemas/label`. - public struct Label: Codable, Hashable, Sendable { - /// Unique identifier for the label. - /// - /// - Remark: Generated from `#/components/schemas/label/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/label/node_id`. - public var nodeId: Swift.String - /// URL for the label - /// - /// - Remark: Generated from `#/components/schemas/label/url`. - public var url: Swift.String - /// The name of the label. - /// - /// - Remark: Generated from `#/components/schemas/label/name`. - public var name: Swift.String - /// Optional description of the label, such as its purpose. - /// - /// - Remark: Generated from `#/components/schemas/label/description`. - public var description: Swift.String? - /// 6-character hex code, without the leading #, identifying the color - /// - /// - Remark: Generated from `#/components/schemas/label/color`. - public var color: Swift.String - /// Whether this label comes by default in a new repository. - /// - /// - Remark: Generated from `#/components/schemas/label/default`. - public var _default: Swift.Bool - /// Creates a new `Label`. - /// - /// - Parameters: - /// - id: Unique identifier for the label. - /// - nodeId: - /// - url: URL for the label - /// - name: The name of the label. - /// - description: Optional description of the label, such as its purpose. - /// - color: 6-character hex code, without the leading #, identifying the color - /// - _default: Whether this label comes by default in a new repository. - public init( - id: Swift.Int64, - nodeId: Swift.String, - url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - color: Swift.String, - _default: Swift.Bool - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case name - case description - case color - case _default = "default" - } - } /// Timeline Comment Event /// /// - Remark: Generated from `#/components/schemas/timeline-comment-event`. @@ -7387,6 +7786,8 @@ public enum Components { public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/timeline-comment-event/reactions`. public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? /// Creates a new `TimelineCommentEvent`. /// /// - Parameters: @@ -7406,6 +7807,7 @@ public enum Components { /// - authorAssociation: /// - performedViaGithubApp: /// - reactions: + /// - pin: public init( event: Swift.String, actor: Components.Schemas.SimpleUser, @@ -7422,7 +7824,8 @@ public enum Components { issueUrl: Swift.String, authorAssociation: Components.Schemas.AuthorAssociation, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - reactions: Components.Schemas.ReactionRollup? = nil + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil ) { self.event = event self.actor = actor @@ -7440,6 +7843,7 @@ public enum Components { self.authorAssociation = authorAssociation self.performedViaGithubApp = performedViaGithubApp self.reactions = reactions + self.pin = pin } public enum CodingKeys: String, CodingKey { case event @@ -7458,6 +7862,7 @@ public enum Components { case authorAssociation = "author_association" case performedViaGithubApp = "performed_via_github_app" case reactions + case pin } } /// Timeline Cross Referenced Event @@ -7997,7 +8402,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/in_reply_to_id`. public var inReplyToId: Swift.Int? /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/user`. - public var user: Components.Schemas.SimpleUser + public var user: Components.Schemas.NullableSimpleUser? /// The text of the comment. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body`. @@ -8191,7 +8596,7 @@ public enum Components { commitId: Swift.String, originalCommitId: Swift.String, inReplyToId: Swift.Int? = nil, - user: Components.Schemas.SimpleUser, + user: Components.Schemas.NullableSimpleUser? = nil, body: Swift.String, createdAt: Foundation.Date, updatedAt: Foundation.Date, @@ -8679,8 +9084,8 @@ public enum Components { self.value21 = value21 self.value22 = value22 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -8821,7 +9226,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) try self.value3?.encode(to: encoder) @@ -9017,6 +9422,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int + /// The unique identifier of the issue field. + /// + /// - Remark: Generated from `#/components/parameters/issue-field-id`. + public typealias IssueFieldId = Swift.Int /// The number that identifies the issue. /// /// - Remark: Generated from `#/components/parameters/issue-number`. @@ -10787,8 +11200,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title/case2`. case case2(Swift.Int) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -10807,7 +11220,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -10836,8 +11249,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone/case2`. case case2(Swift.Int) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -10856,7 +11269,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -10908,8 +11321,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2`. case case2(Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -10928,7 +11341,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -12001,116 +12414,89 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List issue events for a repository + /// Pin an issue comment /// - /// Lists events for a repository. + /// You can use the REST API to pin comments on issues. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. - public enum IssuesListEventsForRepo { - public static let id: Swift.String = "issues/list-events-for-repo" + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. + public enum IssuesPinComment { + public static let id: Swift.String = "issues/pin-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo + self.commentId = commentId } } - public var path: Operations.IssuesListEventsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesListEventsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/header`. + public var path: Operations.IssuesPinComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/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.IssuesListEventsForRepo.Input.Headers + public var headers: Operations.IssuesPinComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListEventsForRepo.Input.Path, - query: Operations.IssuesListEventsForRepo.Input.Query = .init(), - headers: Operations.IssuesListEventsForRepo.Input.Headers = .init() + path: Operations.IssuesPinComment.Input.Path, + headers: Operations.IssuesPinComment.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesListEventsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueEvent]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.IssueComment) /// 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.IssueEvent] { + public var json: Components.Schemas.IssueComment { get throws { switch self { case let .json(body): @@ -12120,31 +12506,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListEventsForRepo.Output.Ok.Body + public var body: Operations.IssuesPinComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers = .init(), - body: Operations.IssuesListEventsForRepo.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesPinComment.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListEventsForRepo.Output.Ok) + case ok(Operations.IssuesPinComment.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.IssuesListEventsForRepo.Output.Ok { + public var ok: Operations.IssuesPinComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -12157,9 +12538,101 @@ public enum Operations { } } } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -12211,153 +12684,185 @@ public enum Operations { } } } - /// Get an issue event + /// Unpin an issue comment /// - /// Gets a single event by the event id. + /// You can use the REST API to unpin comments on issues. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. - public enum IssuesGetEvent { - public static let id: Swift.String = "issues/get-event" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. + public enum IssuesUnpinComment { + public static let id: Swift.String = "issues/unpin-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/event_id`. - public var eventId: Swift.Int + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - eventId: + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - eventId: Swift.Int + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo - self.eventId = eventId + self.commentId = commentId } } - public var path: Operations.IssuesGetEvent.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/header`. + public var path: Operations.IssuesUnpinComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/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.IssuesGetEvent.Input.Headers + public var headers: Operations.IssuesUnpinComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesGetEvent.Input.Path, - headers: Operations.IssuesGetEvent.Input.Headers = .init() + path: Operations.IssuesUnpinComment.Input.Path, + headers: Operations.IssuesUnpinComment.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.IssueEvent) - /// 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.IssueEvent { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesGetEvent.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesGetEvent.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetEvent.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesUnpinComment.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesGetEvent.Output.Ok { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/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.IssuesUnpinComment.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 ) } } } - /// Resource not found + /// Requires authentication /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/401`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .notFound(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unauthorized", response: self ) } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/410`. + /// Forbidden /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/403`. /// - /// - Throws: An error if `self` is not `.gone`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. /// - SeeAlso: `.gone`. public var gone: Components.Responses.Gone { get throws { @@ -12372,24 +12877,24 @@ public enum Operations { } } } - /// Forbidden + /// Service unavailable /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/503`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .forbidden(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "serviceUnavailable", response: self ) } @@ -12426,97 +12931,116 @@ public enum Operations { } } } - /// Get an issue - /// - /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was - /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If - /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API - /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read - /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe - /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. - /// - /// > [!NOTE] - /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// List issue events for a repository /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Lists events for a repository. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. - public enum IssuesGet { - public static let id: Swift.String = "issues/get" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. + public enum IssuesListEventsForRepo { + public static let id: Swift.String = "issues/list-events-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber } } - public var path: Operations.IssuesGet.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/header`. + public var path: Operations.IssuesListEventsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesListEventsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesGet.Input.Headers + public var headers: Operations.IssuesListEventsForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesGet.Input.Path, - headers: Operations.IssuesGet.Input.Headers = .init() + path: Operations.IssuesListEventsForRepo.Input.Path, + query: Operations.IssuesListEventsForRepo.Input.Query = .init(), + headers: Operations.IssuesListEventsForRepo.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesListEventsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueEvent]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: [Components.Schemas.IssueEvent] { get throws { switch self { case let .json(body): @@ -12526,26 +13050,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGet.Output.Ok.Body + public var body: Operations.IssuesListEventsForRepo.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesGet.Output.Ok.Body) { + public init( + headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers = .init(), + body: Operations.IssuesListEventsForRepo.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGet.Output.Ok) + case ok(Operations.IssuesListEventsForRepo.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.IssuesGet.Output.Ok { + public var ok: Operations.IssuesListEventsForRepo.Output.Ok { get throws { switch self { case let .ok(response): @@ -12558,101 +13087,239 @@ public enum Operations { } } } - /// Moved permanently + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/422`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .movedPermanently(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// Undocumented 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 - ) - } + /// 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) } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an issue event + /// + /// Gets a single event by the event id. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. + public enum IssuesGetEvent { + public static let id: Swift.String = "issues/get-event" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/event_id`. + public var eventId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - eventId: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + eventId: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.eventId = eventId + } + } + public var path: Operations.IssuesGetEvent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesGetEvent.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGetEvent.Input.Path, + headers: Operations.IssuesGetEvent.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.IssueEvent) + /// 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.IssueEvent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGetEvent.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGetEvent.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGetEvent.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.IssuesGetEvent.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "ok", response: self ) } } } - /// Not modified + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/404`. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.notModified`. + /// Forbidden /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/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 .notModified(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "forbidden", response: self ) } @@ -12689,9 +13356,17 @@ public enum Operations { } } } - /// Update an issue + /// Get an issue /// - /// Issue owners and users with push access or Triage role can edit an issue. + /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was + /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API + /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read + /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe + /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. + /// + /// > [!NOTE] + /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -12700,24 +13375,24 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. - public enum IssuesUpdate { - public static let id: Swift.String = "issues/update" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. + public enum IssuesGet { + public static let id: Swift.String = "issues/get" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -12735,33 +13410,288 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesUpdate.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/header`. + public var path: Operations.IssuesGet.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/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.IssuesUpdate.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The title of the issue. + public var headers: Operations.IssuesGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGet.Input.Path, + headers: Operations.IssuesGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGet.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.IssuesGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an issue + /// + /// Issue owners and users with push access or Triage role can edit an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. + public enum IssuesUpdate { + public static let id: Swift.String = "issues/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesUpdate.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesUpdate.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. @frozen public enum TitlePayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case1`. case case1(Swift.String) /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case2`. case case2(Swift.Int) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -12780,7 +13710,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -12833,8 +13763,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone/case2`. case case2(Swift.Int) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -12853,7 +13783,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -12905,8 +13835,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2`. case case2(Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -12925,7 +13855,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -12946,21 +13876,109 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. public var assignees: [Swift.String]? - /// The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. - public var _type: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - title: The title of the issue. - /// - body: The contents of the issue. - /// - assignee: Username to assign to this issue. **This field is closing down.** - /// - state: The open or closed state of the issue. - /// - stateReason: The reason for the state change. Ignored unless `state` is changed. - /// - milestone: - /// - labels: Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. - /// - assignees: Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field + public init( + fieldId: Swift.Int, + value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. + public var _type: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the issue. + /// - body: The contents of the issue. + /// - assignee: Username to assign to this issue. **This field is closing down.** + /// - state: The open or closed state of the issue. + /// - stateReason: The reason for the state change. Ignored unless `state` is changed. + /// - milestone: + /// - labels: Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + /// - assignees: Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues /// - _type: The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. public init( title: Operations.IssuesUpdate.Input.Body.JsonPayload.TitlePayload? = nil, @@ -12971,6 +13989,7 @@ public enum Operations { milestone: Operations.IssuesUpdate.Input.Body.JsonPayload.MilestonePayload? = nil, labels: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayload? = nil, assignees: [Swift.String]? = nil, + issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, _type: Swift.String? = nil ) { self.title = title @@ -12981,6 +14000,7 @@ public enum Operations { self.milestone = milestone self.labels = labels self.assignees = assignees + self.issueFieldValues = issueFieldValues self._type = _type } public enum CodingKeys: String, CodingKey { @@ -12992,6 +14012,7 @@ public enum Operations { case milestone case labels case assignees + case issueFieldValues = "issue_field_values" case _type = "type" } } @@ -15714,28 +16735,28 @@ public enum Operations { } } } - /// List labels for an issue + /// List issue field values for an issue /// - /// Lists all labels for an issue. + /// Lists all issue field values for an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. - public enum IssuesListLabelsOnIssue { - public static let id: Swift.String = "issues/list-labels-on-issue" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. + public enum IssuesListIssueFieldValuesForIssue { + public static let id: Swift.String = "issues/list-issue-field-values-for-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -15753,16 +16774,16 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListLabelsOnIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query`. + public var path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -15777,19 +16798,19 @@ public enum Operations { self.page = page } } - public var query: Operations.IssuesListLabelsOnIssue.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/header`. + public var query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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.IssuesListLabelsOnIssue.Input.Headers + public var headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -15797,9 +16818,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListLabelsOnIssue.Input.Path, - query: Operations.IssuesListLabelsOnIssue.Input.Query = .init(), - headers: Operations.IssuesListLabelsOnIssue.Input.Headers = .init() + path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path, + query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query = .init(), + headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers = .init() ) { self.path = path self.query = query @@ -15808,9 +16829,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -15821,16 +16842,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content`. + public var headers: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) /// 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.Label] { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -15840,15 +16861,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body + public var body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers = .init(), - body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body + headers: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body ) { self.headers = headers self.body = body @@ -15856,15 +16877,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListLabelsOnIssue.Output.Ok) + case ok(Operations.IssuesListIssueFieldValuesForIssue.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.IssuesListLabelsOnIssue.Output.Ok { + public var ok: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -15879,7 +16900,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -15902,7 +16923,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -15925,7 +16946,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -15977,28 +16998,28 @@ public enum Operations { } } } - /// Add labels to an issue + /// List labels for an issue /// - /// Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. + /// Lists all labels for an issue. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. - public enum IssuesAddLabels { - public static let id: Swift.String = "issues/add-labels" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. + public enum IssuesListLabelsOnIssue { + public static let id: Swift.String = "issues/list-labels-on-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16016,179 +17037,80 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesAddLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/header`. + public var path: Operations.IssuesListLabelsOnIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/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.IssuesListLabelsOnIssue.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/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.IssuesAddLabels.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. - public var labels: [Swift.String]? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - labels: The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." - public init(labels: [Swift.String]? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. - case case1(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case2`. - case case2([Swift.String]) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. - public struct Case3Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3/LabelsPayload/name`. - public var name: Swift.String - /// Creates a new `LabelsPayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3/labels`. - public typealias LabelsPayload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3/labels`. - public var labels: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? - /// Creates a new `Case3Payload`. - /// - /// - Parameters: - /// - labels: - public init(labels: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. - case case3(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case4Payload`. - public struct Case4PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case4Payload/name`. - public var name: Swift.String - /// Creates a new `Case4PayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case4`. - public typealias Case4Payload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case4PayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case4`. - case case4(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case4Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case5`. - case case5(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case4(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case5(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try value.encode(to: encoder) - case let .case4(value): - try encoder.encodeToSingleValueContainer(value) - case let .case5(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddLabels.Input.Body.JsonPayload) - } - public var body: Operations.IssuesAddLabels.Input.Body? + public var headers: Operations.IssuesListLabelsOnIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesAddLabels.Input.Path, - headers: Operations.IssuesAddLabels.Input.Headers = .init(), - body: Operations.IssuesAddLabels.Input.Body? = nil + path: Operations.IssuesListLabelsOnIssue.Input.Path, + query: Operations.IssuesListLabelsOnIssue.Input.Query = .init(), + headers: Operations.IssuesListLabelsOnIssue.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/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.IssuesListLabelsOnIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) + /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. @@ -16202,26 +17124,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddLabels.Output.Ok.Body + public var body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesAddLabels.Output.Ok.Body) { + public init( + headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesAddLabels.Output.Ok) + case ok(Operations.IssuesListLabelsOnIssue.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.IssuesAddLabels.Output.Ok { + public var ok: Operations.IssuesListLabelsOnIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -16236,7 +17163,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -16259,7 +17186,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16282,7 +17209,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -16303,29 +17230,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/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. @@ -16357,28 +17261,28 @@ public enum Operations { } } } - /// Set labels for an issue + /// Add labels to an issue /// - /// Removes any previous labels and sets the new labels for an issue. + /// Adds labels to an issue. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. - public enum IssuesSetLabels { - public static let id: Swift.String = "issues/set-labels" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. + public enum IssuesAddLabels { + public static let id: Swift.String = "issues/add-labels" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16396,33 +17300,33 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesSetLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/header`. + public var path: Operations.IssuesAddLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesSetLabels.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody`. + public var headers: Operations.IssuesAddLabels.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json`. @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. public struct Case1Payload: Codable, Hashable, Sendable { - /// The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + /// The names of the labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1/labels`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. public var labels: [Swift.String]? /// Creates a new `Case1Payload`. /// /// - Parameters: - /// - labels: The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + /// - labels: The names of the labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." public init(labels: [Swift.String]? = nil) { self.labels = labels } @@ -16430,49 +17334,15 @@ public enum Operations { case labels } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. - case case1(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case2`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. + case case1(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case2`. case case2([Swift.String]) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. - public struct Case3Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload/name`. - public var name: Swift.String - /// Creates a new `LabelsPayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. - public typealias LabelsPayload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. - public var labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? - /// Creates a new `Case3Payload`. - /// - /// - Parameters: - /// - labels: - public init(labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. - case case3(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload`. - public struct Case4PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload/name`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload`. + public struct Case3PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/name`. public var name: Swift.String - /// Creates a new `Case4PayloadPayload`. + /// Creates a new `Case3PayloadPayload`. /// /// - Parameters: /// - name: @@ -16483,14 +17353,12 @@ public enum Operations { case name } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. - public typealias Case4Payload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4PayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. - case case4(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case5`. - case case5(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. + public typealias Case3Payload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. + case case3(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -16504,19 +17372,7 @@ public enum Operations { errors.append(error) } do { - self = .case3(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case4(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case5(try decoder.decodeFromSingleValueContainer()) + self = .case3(try decoder.decodeFromSingleValueContainer()) return } catch { errors.append(error) @@ -16527,25 +17383,21 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) case let .case2(value): try encoder.encodeToSingleValueContainer(value) case let .case3(value): - try value.encode(to: encoder) - case let .case4(value): - try encoder.encodeToSingleValueContainer(value) - case let .case5(value): try encoder.encodeToSingleValueContainer(value) } } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/content/application\/json`. - case json(Operations.IssuesSetLabels.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddLabels.Input.Body.JsonPayload) } - public var body: Operations.IssuesSetLabels.Input.Body? + public var body: Operations.IssuesAddLabels.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -16553,9 +17405,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesSetLabels.Input.Path, - headers: Operations.IssuesSetLabels.Input.Headers = .init(), - body: Operations.IssuesSetLabels.Input.Body? = nil + path: Operations.IssuesAddLabels.Input.Path, + headers: Operations.IssuesAddLabels.Input.Headers = .init(), + body: Operations.IssuesAddLabels.Input.Body? = nil ) { self.path = path self.headers = headers @@ -16564,9 +17416,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content/application\/json`. case json([Components.Schemas.Label]) /// The associated value of the enum case if `self` is `.json`. /// @@ -16582,26 +17434,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesSetLabels.Output.Ok.Body + public var body: Operations.IssuesAddLabels.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesSetLabels.Output.Ok.Body) { + public init(body: Operations.IssuesAddLabels.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesSetLabels.Output.Ok) + case ok(Operations.IssuesAddLabels.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.IssuesSetLabels.Output.Ok { + public var ok: Operations.IssuesAddLabels.Output.Ok { get throws { switch self { case let .ok(response): @@ -16616,7 +17468,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -16639,7 +17491,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16662,7 +17514,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -16685,7 +17537,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -16737,28 +17589,28 @@ public enum Operations { } } } - /// Remove all labels from an issue + /// Set labels for an issue /// - /// Removes all labels from an issue. + /// Removes any previous labels and sets the new labels for an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. - public enum IssuesRemoveAllLabels { - public static let id: Swift.String = "issues/remove-all-labels" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. + public enum IssuesSetLabels { + public static let id: Swift.String = "issues/set-labels" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16776,63 +17628,219 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesRemoveAllLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/header`. + public var path: Operations.IssuesSetLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveAllLabels.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.IssuesRemoveAllLabels.Input.Path, - headers: Operations.IssuesRemoveAllLabels.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + public var headers: Operations.IssuesSetLabels.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1/labels`. + public var labels: [Swift.String]? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - labels: The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + public init(labels: [Swift.String]? = nil) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. + case case1(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case2`. + case case2([Swift.String]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload/name`. + public var name: Swift.String + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - name: + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. + public typealias LabelsPayload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. + public var labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - labels: + public init(labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? = nil) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. + case case3(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload`. + public struct Case4PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload/name`. + public var name: Swift.String + /// Creates a new `Case4PayloadPayload`. + /// + /// - Parameters: + /// - name: + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. + public typealias Case4Payload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. + case case4(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case5`. + case case5(Swift.String) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case4(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case5(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try value.encode(to: encoder) + case let .case4(value): + try encoder.encodeToSingleValueContainer(value) + case let .case5(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesSetLabels.Input.Body.JsonPayload) + } + public var body: Operations.IssuesSetLabels.Input.Body? + /// Creates a new `Input`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesRemoveAllLabels.Output.NoContent) + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesSetLabels.Input.Path, + headers: Operations.IssuesSetLabels.Input.Headers = .init(), + body: Operations.IssuesSetLabels.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) + /// 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.Label] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesSetLabels.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesSetLabels.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/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.IssuesSetLabels.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.IssuesRemoveAllLabels.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesSetLabels.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -16840,7 +17848,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -16863,7 +17871,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16886,7 +17894,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -16907,6 +17915,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/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. @@ -16938,43 +17969,244 @@ public enum Operations { } } } - /// Remove a label from an issue + /// Remove all labels from an issue /// - /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. + /// Removes all labels from an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. - public enum IssuesRemoveLabel { - public static let id: Swift.String = "issues/remove-label" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. + public enum IssuesRemoveAllLabels { + public static let id: Swift.String = "issues/remove-all-labels" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/name`. - public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. - /// - name: public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, - name: Swift.String + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesRemoveAllLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesRemoveAllLabels.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesRemoveAllLabels.Input.Path, + headers: Operations.IssuesRemoveAllLabels.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesRemoveAllLabels.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/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.IssuesRemoveAllLabels.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove a label from an issue + /// + /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. + public enum IssuesRemoveLabel { + public static let id: Swift.String = "issues/remove-label" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/name`. + public var name: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + /// - name: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + name: Swift.String ) { self.owner = owner self.repo = repo @@ -21044,39 +22276,1018 @@ public enum Operations { } /// 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.IssuesDeleteMilestone.Output.NoContent { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesDeleteMilestone.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List labels for issues in a milestone + /// + /// Lists labels for issues in a milestone. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)`. + public enum IssuesListLabelsForMilestone { + public static let id: Swift.String = "issues/list-labels-for-milestone" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/milestone_number`. + public var milestoneNumber: Components.Parameters.MilestoneNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - milestoneNumber: The number that identifies the milestone. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + milestoneNumber: Components.Parameters.MilestoneNumber + ) { + self.owner = owner + self.repo = repo + self.milestoneNumber = milestoneNumber + } + } + public var path: Operations.IssuesListLabelsForMilestone.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/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.IssuesListLabelsForMilestone.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListLabelsForMilestone.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListLabelsForMilestone.Input.Path, + query: Operations.IssuesListLabelsForMilestone.Input.Query = .init(), + headers: Operations.IssuesListLabelsForMilestone.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/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.IssuesListLabelsForMilestone.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) + /// 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.Label] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListLabelsForMilestone.Output.Ok.Headers = .init(), + body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListLabelsForMilestone.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.IssuesListLabelsForMilestone.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add issue field values to an issue + /// + /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// Adding an empty array will clear all existing field values for the issue. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. + public enum IssuesAddIssueFieldValues { + public static let id: Swift.String = "issues/add-issue-field-values" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - repositoryId: The unique identifier of the repository. + /// - issueNumber: The number that identifies the issue. + public init( + repositoryId: Components.Parameters.RepositoryId, + issueNumber: Components.Parameters.IssueNumber + ) { + self.repositoryId = repositoryId + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesAddIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesAddIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// The value to set for text, single_select, or date fields + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// The value to set for number fields + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. The type depends on the field's data type: + public init( + fieldId: Swift.Int, + value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueFieldValues: An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + public init(issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case issueFieldValues = "issue_field_values" + } + } + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddIssueFieldValues.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesAddIssueFieldValues.Input.Path, + headers: Operations.IssuesAddIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesAddIssueFieldValues.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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) + /// 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.IssueFieldValue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesAddIssueFieldValues.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.IssuesAddIssueFieldValues.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/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//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/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//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/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 + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Set issue field values for an issue + /// + /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields + /// + /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. + /// + /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `PUT /repositories/{repository_id}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. + public enum IssuesSetIssueFieldValues { + public static let id: Swift.String = "issues/set-issue-field-values" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - repositoryId: The unique identifier of the repository. + /// - issueNumber: The number that identifies the issue. + public init( + repositoryId: Components.Parameters.RepositoryId, + issueNumber: Components.Parameters.IssueNumber + ) { + self.repositoryId = repositoryId + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesSetIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/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.IssuesSetIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// The value to set for text, single_select, or date fields + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// The value to set for number fields + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. The type depends on the field's data type: + public init( + fieldId: Swift.Int, + value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + /// + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueFieldValues: An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + public init(issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case issueFieldValues = "issue_field_values" + } + } + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload) + } + public var body: Operations.IssuesSetIssueFieldValues.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesSetIssueFieldValues.Input.Path, + headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesSetIssueFieldValues.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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) + /// 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.IssueFieldValue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesSetIssueFieldValues.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.IssuesSetIssueFieldValues.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/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//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/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//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/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 .noContent(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Resource not found + /// Service unavailable /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/404`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/503`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .notFound(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "serviceUnavailable", response: self ) } @@ -21089,11 +23300,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -21104,173 +23318,213 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// List labels for issues in a milestone + /// Delete an issue field value from an issue /// - /// Lists labels for issues in a milestone. + /// Remove a specific custom field value from an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)`. - public enum IssuesListLabelsForMilestone { - public static let id: Swift.String = "issues/list-labels-for-milestone" + /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// If the specified field does not have a value set on the issue, this operation will return a `404` error. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `DELETE /repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. + public enum IssuesDeleteIssueFieldValue { + public static let id: Swift.String = "issues/delete-issue-field-value" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path`. + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies the milestone. + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// The unique identifier of the issue field. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path/milestone_number`. - public var milestoneNumber: Components.Parameters.MilestoneNumber + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_field_id`. + public var issueFieldId: Components.Parameters.IssueFieldId /// Creates a new `Path`. /// /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - milestoneNumber: The number that identifies the milestone. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - milestoneNumber: Components.Parameters.MilestoneNumber - ) { - self.owner = owner - self.repo = repo - self.milestoneNumber = milestoneNumber - } - } - public var path: Operations.IssuesListLabelsForMilestone.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/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)." + /// - repositoryId: The unique identifier of the repository. + /// - issueNumber: The number that identifies the issue. + /// - issueFieldId: The unique identifier of the issue field. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + repositoryId: Components.Parameters.RepositoryId, + issueNumber: Components.Parameters.IssueNumber, + issueFieldId: Components.Parameters.IssueFieldId ) { - self.perPage = perPage - self.page = page + self.repositoryId = repositoryId + self.issueNumber = issueNumber + self.issueFieldId = issueFieldId } } - public var query: Operations.IssuesListLabelsForMilestone.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/header`. + public var path: Operations.IssuesDeleteIssueFieldValue.Input.Path + /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_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.IssuesListLabelsForMilestone.Input.Headers + public var headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListLabelsForMilestone.Input.Path, - query: Operations.IssuesListLabelsForMilestone.Input.Query = .init(), - headers: Operations.IssuesListLabelsForMilestone.Input.Headers = .init() + path: Operations.IssuesDeleteIssueFieldValue.Input.Path, + headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Issue field value deleted successfully + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesDeleteIssueFieldValue.Output.NoContent) + /// Issue field value deleted successfully + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/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.IssuesDeleteIssueFieldValue.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response headers - public var headers: Operations.IssuesListLabelsForMilestone.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) - /// 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.Label] { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListLabelsForMilestone.Output.Ok.Headers = .init(), - body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body - ) { - self.headers = headers - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/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//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)/responses/200`. + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListLabelsForMilestone.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.IssuesListLabelsForMilestone.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 + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", response: self ) } From a73e548662116bd50495e4bd3103ac4cf8bae901 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:11:15 +0000 Subject: [PATCH 14/33] Commit via running: make Sources/migrations --- Sources/migrations/Types.swift | 185 +++++++++++++++++++++++++++++++-- 1 file changed, 178 insertions(+), 7 deletions(-) diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 891b6e61f4..08d3099b87 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -986,8 +986,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1012,7 +1012,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1485,6 +1485,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1730,6 +1749,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1827,6 +1849,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1924,6 +1949,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2022,6 +2050,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2267,6 +2298,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2277,6 +2409,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2284,7 +2419,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2293,6 +2431,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2302,6 +2443,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -2444,6 +2588,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2579,10 +2738,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -2660,6 +2819,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -2749,6 +2911,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -2838,6 +3003,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2928,6 +3096,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -6101,7 +6272,7 @@ public enum Operations { case email case name } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.email = try container.decodeIfPresent( Swift.String.self, From 5e4f7898b4c0cafb6aca020ba4cf3c9ccdbe4d0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:11:37 +0000 Subject: [PATCH 15/33] Commit via running: make Sources/oidc --- Sources/oidc/Client.swift | 568 ++++++++++++++ Sources/oidc/Types.swift | 1493 ++++++++++++++++++++++++++++++++++++- 2 files changed, 2060 insertions(+), 1 deletion(-) diff --git a/Sources/oidc/Client.swift b/Sources/oidc/Client.swift index 9eb3f08e56..a7dcea9813 100644 --- a/Sources/oidc/Client.swift +++ b/Sources/oidc/Client.swift @@ -38,6 +38,574 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List OIDC custom property inclusions for an enterprise + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)`. + public func oidcListOidcCustomPropertyInclusionsForEnterprise(_ input: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/actions/oidc/customization/properties/repo", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.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.OidcCustomPropertyInclusion].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an OIDC custom property inclusion for an enterprise + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)`. + public func oidcCreateOidcCustomPropertyInclusionForEnterprise(_ input: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/actions/oidc/customization/properties/repo", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.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.OidcCustomPropertyInclusion.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 400: + return .badRequest(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an OIDC custom property inclusion for an enterprise + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)`. + public func oidcDeleteOidcCustomPropertyInclusionForEnterprise(_ input: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/actions/oidc/customization/properties/repo/{}", + parameters: [ + input.path.enterprise, + input.path.customPropertyName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + return .badRequest(.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: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List OIDC custom property inclusions for an organization + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)`. + public func oidcListOidcCustomPropertyInclusionsForOrg(_ input: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.OidcListOidcCustomPropertyInclusionsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/oidc/customization/properties/repo", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OidcListOidcCustomPropertyInclusionsForOrg.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.OidcCustomPropertyInclusion].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an OIDC custom property inclusion for an organization + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)`. + public func oidcCreateOidcCustomPropertyInclusionForOrg(_ input: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/oidc/customization/properties/repo", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.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.OidcCustomPropertyInclusion.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 400: + return .badRequest(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an OIDC custom property inclusion for an organization + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)`. + public func oidcDeleteOidcCustomPropertyInclusionForOrg(_ input: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/oidc/customization/properties/repo/{}", + parameters: [ + input.path.org, + input.path.customPropertyName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + return .badRequest(.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: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get the customization template for an OIDC subject claim for an organization /// /// Gets the customization template for an OpenID Connect (OIDC) subject claim. diff --git a/Sources/oidc/Types.swift b/Sources/oidc/Types.swift index 3278892c11..060c0167e6 100644 --- a/Sources/oidc/Types.swift +++ b/Sources/oidc/Types.swift @@ -11,6 +11,60 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// List OIDC custom property inclusions for an enterprise + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)`. + func oidcListOidcCustomPropertyInclusionsForEnterprise(_ input: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Output + /// Create an OIDC custom property inclusion for an enterprise + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)`. + func oidcCreateOidcCustomPropertyInclusionForEnterprise(_ input: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output + /// Delete an OIDC custom property inclusion for an enterprise + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)`. + func oidcDeleteOidcCustomPropertyInclusionForEnterprise(_ input: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output + /// List OIDC custom property inclusions for an organization + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)`. + func oidcListOidcCustomPropertyInclusionsForOrg(_ input: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForOrg.Output + /// Create an OIDC custom property inclusion for an organization + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)`. + func oidcCreateOidcCustomPropertyInclusionForOrg(_ input: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output + /// Delete an OIDC custom property inclusion for an organization + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)`. + func oidcDeleteOidcCustomPropertyInclusionForOrg(_ input: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output /// Get the customization template for an OIDC subject claim for an organization /// /// Gets the customization template for an OpenID Connect (OIDC) subject claim. @@ -33,6 +87,112 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// List OIDC custom property inclusions for an enterprise + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)`. + public func oidcListOidcCustomPropertyInclusionsForEnterprise( + path: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Path, + headers: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Headers = .init() + ) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Output { + try await oidcListOidcCustomPropertyInclusionsForEnterprise(Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input( + path: path, + headers: headers + )) + } + /// Create an OIDC custom property inclusion for an enterprise + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)`. + public func oidcCreateOidcCustomPropertyInclusionForEnterprise( + path: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Path, + headers: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Headers = .init(), + body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Body + ) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output { + try await oidcCreateOidcCustomPropertyInclusionForEnterprise(Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an OIDC custom property inclusion for an enterprise + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)`. + public func oidcDeleteOidcCustomPropertyInclusionForEnterprise( + path: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input.Path, + headers: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input.Headers = .init() + ) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output { + try await oidcDeleteOidcCustomPropertyInclusionForEnterprise(Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input( + path: path, + headers: headers + )) + } + /// List OIDC custom property inclusions for an organization + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)`. + public func oidcListOidcCustomPropertyInclusionsForOrg( + path: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input.Path, + headers: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input.Headers = .init() + ) async throws -> Operations.OidcListOidcCustomPropertyInclusionsForOrg.Output { + try await oidcListOidcCustomPropertyInclusionsForOrg(Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input( + path: path, + headers: headers + )) + } + /// Create an OIDC custom property inclusion for an organization + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)`. + public func oidcCreateOidcCustomPropertyInclusionForOrg( + path: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Path, + headers: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Headers = .init(), + body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Body + ) async throws -> Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output { + try await oidcCreateOidcCustomPropertyInclusionForOrg(Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an OIDC custom property inclusion for an organization + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)`. + public func oidcDeleteOidcCustomPropertyInclusionForOrg( + path: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input.Path, + headers: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input.Headers = .init() + ) async throws -> Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output { + try await oidcDeleteOidcCustomPropertyInclusionForOrg(Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input( + path: path, + headers: headers + )) + } /// Get the customization template for an OIDC subject claim for an organization /// /// Gets the customization template for an OpenID Connect (OIDC) subject claim. @@ -131,6 +291,61 @@ public enum Components { case status } } + /// An OIDC custom property inclusion for repository properties + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion`. + public struct OidcCustomPropertyInclusion: Codable, Hashable, Sendable { + /// The name of the custom property that is included in the OIDC token + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion/custom_property_name`. + public var customPropertyName: Swift.String + /// Whether the inclusion was defined at the organization or enterprise level + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion/inclusion_source`. + @frozen public enum InclusionSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case organization = "organization" + case enterprise = "enterprise" + } + /// Whether the inclusion was defined at the organization or enterprise level + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion/inclusion_source`. + public var inclusionSource: Components.Schemas.OidcCustomPropertyInclusion.InclusionSourcePayload + /// Creates a new `OidcCustomPropertyInclusion`. + /// + /// - Parameters: + /// - customPropertyName: The name of the custom property that is included in the OIDC token + /// - inclusionSource: Whether the inclusion was defined at the organization or enterprise level + public init( + customPropertyName: Swift.String, + inclusionSource: Components.Schemas.OidcCustomPropertyInclusion.InclusionSourcePayload + ) { + self.customPropertyName = customPropertyName + self.inclusionSource = inclusionSource + } + public enum CodingKeys: String, CodingKey { + case customPropertyName = "custom_property_name" + case inclusionSource = "inclusion_source" + } + } + /// Input for creating an OIDC custom property inclusion + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion-input`. + public struct OidcCustomPropertyInclusionInput: Codable, Hashable, Sendable { + /// The name of the custom property to include in the OIDC token + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-property-inclusion-input/custom_property_name`. + public var customPropertyName: Swift.String + /// Creates a new `OidcCustomPropertyInclusionInput`. + /// + /// - Parameters: + /// - customPropertyName: The name of the custom property to include in the OIDC token + public init(customPropertyName: Swift.String) { + self.customPropertyName = customPropertyName + } + public enum CodingKeys: String, CodingKey { + case customPropertyName = "custom_property_name" + } + } /// Actions OIDC Subject customization /// /// - Remark: Generated from `#/components/schemas/oidc-custom-sub`. @@ -156,13 +371,17 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. @@ -235,6 +454,1278 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { + /// List OIDC custom property inclusions for an enterprise + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)`. + public enum OidcListOidcCustomPropertyInclusionsForEnterprise { + public static let id: Swift.String = "oidc/list-oidc-custom-property-inclusions-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Path, + headers: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OidcCustomPropertyInclusion]) + /// 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.OidcCustomPropertyInclusion] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.Output.Ok.Body) { + self.body = body + } + } + /// A JSON array of OIDC custom property inclusions + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OidcListOidcCustomPropertyInclusionsForEnterprise.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.OidcListOidcCustomPropertyInclusionsForEnterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an OIDC custom property inclusion for an enterprise + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)`. + public enum OidcCreateOidcCustomPropertyInclusionForEnterprise { + public static let id: Swift.String = "oidc/create-oidc-custom-property-inclusion-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/requestBody/content/application\/json`. + case json(Components.Schemas.OidcCustomPropertyInclusionInput) + } + public var body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Path, + headers: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Headers = .init(), + body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OidcCustomPropertyInclusion) + /// 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.OidcCustomPropertyInclusion { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.Created.Body) { + self.body = body + } + } + /// OIDC custom property inclusion created + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// Creates a new `BadRequest`. + public init() {} + } + /// Invalid input + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.BadRequest) + /// Invalid input + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + public static var badRequest: Self { + .badRequest(.init()) + } + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Property inclusion already exists + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.UnprocessableContent) + /// Property inclusion already exists + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OidcCreateOidcCustomPropertyInclusionForEnterprise.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an OIDC custom property inclusion for an enterprise + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)`. + public enum OidcDeleteOidcCustomPropertyInclusionForEnterprise { + public static let id: Swift.String = "oidc/delete-oidc-custom-property-inclusion-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The name of the custom property to remove from OIDC token inclusion + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path/custom_property_name`. + public var customPropertyName: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - customPropertyName: The name of the custom property to remove from OIDC token inclusion + public init( + enterprise: Components.Parameters.Enterprise, + customPropertyName: Swift.String + ) { + self.enterprise = enterprise + self.customPropertyName = customPropertyName + } + } + public var path: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Input.Path, + headers: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.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() {} + } + /// OIDC custom property inclusion deleted + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.NoContent) + /// OIDC custom property inclusion deleted + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/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.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// Creates a new `BadRequest`. + public init() {} + } + /// Invalid input + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.BadRequest) + /// Invalid input + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + public static var badRequest: Self { + .badRequest(.init()) + } + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Property inclusion not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.NotFound) + /// Property inclusion not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.OidcDeleteOidcCustomPropertyInclusionForEnterprise.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List OIDC custom property inclusions for an organization + /// + /// Lists the repository custom properties that are included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)`. + public enum OidcListOidcCustomPropertyInclusionsForOrg { + public static let id: Swift.String = "oidc/list-oidc-custom-property-inclusions-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Input.Path, + headers: Operations.OidcListOidcCustomPropertyInclusionsForOrg.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/oidc/customization/properties/repo/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OidcCustomPropertyInclusion]) + /// 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.OidcCustomPropertyInclusion] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OidcListOidcCustomPropertyInclusionsForOrg.Output.Ok.Body) { + self.body = body + } + } + /// A JSON array of OIDC custom property inclusions + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OidcListOidcCustomPropertyInclusionsForOrg.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.OidcListOidcCustomPropertyInclusionsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/get(oidc/list-oidc-custom-property-inclusions-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an OIDC custom property inclusion for an organization + /// + /// Adds a repository custom property to be included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/oidc/customization/properties/repo`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)`. + public enum OidcCreateOidcCustomPropertyInclusionForOrg { + public static let id: Swift.String = "oidc/create-oidc-custom-property-inclusion-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/requestBody/content/application\/json`. + case json(Components.Schemas.OidcCustomPropertyInclusionInput) + } + public var body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Path, + headers: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Input.Headers = .init(), + body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.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/oidc/customization/properties/repo/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OidcCustomPropertyInclusion) + /// 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.OidcCustomPropertyInclusion { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.Created.Body) { + self.body = body + } + } + /// OIDC custom property inclusion created + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// Creates a new `BadRequest`. + public init() {} + } + /// Invalid input + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.BadRequest) + /// Invalid input + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + public static var badRequest: Self { + .badRequest(.init()) + } + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Property inclusion already exists + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.UnprocessableContent) + /// Property inclusion already exists + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/post(oidc/create-oidc-custom-property-inclusion-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OidcCreateOidcCustomPropertyInclusionForOrg.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an OIDC custom property inclusion for an organization + /// + /// Removes a repository custom property from being included in the OIDC token for repository actions in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)`. + public enum OidcDeleteOidcCustomPropertyInclusionForOrg { + public static let id: Swift.String = "oidc/delete-oidc-custom-property-inclusion-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the custom property to remove from OIDC token inclusion + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/path/custom_property_name`. + public var customPropertyName: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - customPropertyName: The name of the custom property to remove from OIDC token inclusion + public init( + org: Components.Parameters.Org, + customPropertyName: Swift.String + ) { + self.org = org + self.customPropertyName = customPropertyName + } + } + public var path: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Input.Path, + headers: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.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() {} + } + /// OIDC custom property inclusion deleted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.NoContent) + /// OIDC custom property inclusion deleted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// Creates a new `BadRequest`. + public init() {} + } + /// Invalid input + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.BadRequest) + /// Invalid input + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + public static var badRequest: Self { + .badRequest(.init()) + } + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Property inclusion not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.NotFound) + /// Property inclusion not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}/delete(oidc/delete-oidc-custom-property-inclusion-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.OidcDeleteOidcCustomPropertyInclusionForOrg.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get the customization template for an OIDC subject claim for an organization /// /// Gets the customization template for an OpenID Connect (OIDC) subject claim. From fc9683c2cf59aa9295ea12046e1d050cdd7fa88d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:12:00 +0000 Subject: [PATCH 16/33] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 952 ++- Sources/orgs/Types.swift | 11208 +++++++++++++++++++++--------------- 2 files changed, 7324 insertions(+), 4836 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 52ad7cee54..bd142e9956 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -127,248 +127,6 @@ public struct Client: APIProtocol { } ) } - /// Get all custom property values for an organization - /// - /// Gets all custom property values that are set for an organization. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope - /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above - /// - /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. - public func orgsCustomPropertiesForOrgsGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/organizations/{}/org-properties/values", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.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.CustomPropertyValue].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create or update custom property values for an organization - /// - /// Create new or update existing custom property values for an organization. - /// To remove a custom property value from an organization, set the property value to `null`. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope - /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission - /// - /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. - public func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/organizations/{}/org-properties/values", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 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 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } /// Get an organization /// /// Gets information about an organization. @@ -706,21 +464,31 @@ public struct Client: APIProtocol { } ) } - /// Create artifact metadata storage record - /// - /// Create metadata storage records for artifacts associated with an organization. - /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and - /// associated with a repository owned by the organization. - /// - /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. - public func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { + /// Create an artifact deployment record + /// + /// Create or update deployment records for an artifact associated + /// with an organization. + /// This endpoint allows you to record information about a specific + /// artifact, such as its name, digest, environments, cluster, and + /// deployment. + /// The deployment name has to be uniqe within a cluster (i.e a + /// combination of logical, physical environment and cluster) as it + /// identifies unique deployment. + /// Multiple requests for the same combination of logical, physical + /// environment, cluster and deployment name will only create one + /// record, successive request will update the existing record. + /// This allows for a stable tracking of a deployment where the actual + /// deployed artifact can change over time. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)`. + public func orgsCreateArtifactDeploymentRecord(_ input: Operations.OrgsCreateArtifactDeploymentRecord.Input) async throws -> Operations.OrgsCreateArtifactDeploymentRecord.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateArtifactStorageRecord.id, + forOperation: Operations.OrgsCreateArtifactDeploymentRecord.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/artifacts/metadata/storage-record", + template: "/orgs/{}/artifacts/metadata/deployment-record", parameters: [ input.path.org ] @@ -749,7 +517,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + let body: Operations.OrgsCreateArtifactDeploymentRecord.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -759,7 +527,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.self, + Operations.OrgsCreateArtifactDeploymentRecord.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -781,42 +549,52 @@ public struct Client: APIProtocol { } ) } - /// List artifact storage records - /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// Set cluster deployment records /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Set deployment records for a given cluster. + /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', + /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. + /// If no existing records match, new records will be created. /// - /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. - public func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output { + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. + public func orgsSetClusterDeploymentRecords(_ input: Operations.OrgsSetClusterDeploymentRecords.Input) async throws -> Operations.OrgsSetClusterDeploymentRecords.Output { try await client.send( input: input, - forOperation: Operations.OrgsListArtifactStorageRecords.id, + forOperation: Operations.OrgsSetClusterDeploymentRecords.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/artifacts/{}/metadata/storage-records", + template: "/orgs/{}/artifacts/metadata/deployment-record/cluster/{}", parameters: [ input.path.org, - input.path.subjectDigest + input.path.cluster ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + let body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -826,7 +604,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.self, + Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -848,9 +626,216 @@ public struct Client: APIProtocol { } ) } - /// List attestations by bulk subject digests + /// Create artifact metadata storage record /// - /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCreateArtifactStorageRecord.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/metadata/storage-record", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List artifact deployment records + /// + /// List deployment records for an artifact metadata associated with an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/get(orgs/list-artifact-deployment-records)`. + public func orgsListArtifactDeploymentRecords(_ input: Operations.OrgsListArtifactDeploymentRecords.Input) async throws -> Operations.OrgsListArtifactDeploymentRecords.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListArtifactDeploymentRecords.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/{}/metadata/deployment-records", + parameters: [ + input.path.org, + input.path.subjectDigest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListArtifactDeploymentRecords.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsListArtifactDeploymentRecords.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListArtifactStorageRecords.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/{}/metadata/storage-records", + parameters: [ + input.path.org, + input.path.subjectDigest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. /// /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. /// @@ -4253,6 +4238,431 @@ public struct Client: APIProtocol { } ) } + /// List issue fields for an organization + /// + /// Lists all issue fields for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)`. + public func orgsListIssueFields(_ input: Operations.OrgsListIssueFields.Input) async throws -> Operations.OrgsListIssueFields.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListIssueFields.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-fields", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListIssueFields.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.IssueField].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create issue field for an organization + /// + /// Creates a new issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)`. + public func orgsCreateIssueField(_ input: Operations.OrgsCreateIssueField.Input) async throws -> Operations.OrgsCreateIssueField.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCreateIssueField.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-fields", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateIssueField.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.IssueField.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update issue field for an organization + /// + /// Updates an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)`. + public func orgsUpdateIssueField(_ input: Operations.OrgsUpdateIssueField.Input) async throws -> Operations.OrgsUpdateIssueField.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsUpdateIssueField.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-fields/{}", + parameters: [ + input.path.org, + input.path.issueFieldId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsUpdateIssueField.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.IssueField.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete issue field for an organization + /// + /// Deletes an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)`. + public func orgsDeleteIssueField(_ input: Operations.OrgsDeleteIssueField.Input) async throws -> Operations.OrgsDeleteIssueField.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsDeleteIssueField.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-fields/{}", + parameters: [ + input.path.org, + input.path.issueFieldId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List issue types for an organization /// /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 7a80e82c57..909d7be624 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -21,35 +21,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /organizations`. /// - Remark: Generated from `#/paths//organizations/get(orgs/list)`. func orgsList(_ input: Operations.OrgsList.Input) async throws -> Operations.OrgsList.Output - /// Get all custom property values for an organization - /// - /// Gets all custom property values that are set for an organization. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope - /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above - /// - /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. - func orgsCustomPropertiesForOrgsGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output - /// Create or update custom property values for an organization - /// - /// Create new or update existing custom property values for an organization. - /// To remove a custom property value from an organization, set the property value to `null`. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope - /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission - /// - /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. - func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output /// Get an organization /// /// Gets information about an organization. @@ -95,6 +66,35 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}`. /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. func orgsDelete(_ input: Operations.OrgsDelete.Input) async throws -> Operations.OrgsDelete.Output + /// Create an artifact deployment record + /// + /// Create or update deployment records for an artifact associated + /// with an organization. + /// This endpoint allows you to record information about a specific + /// artifact, such as its name, digest, environments, cluster, and + /// deployment. + /// The deployment name has to be uniqe within a cluster (i.e a + /// combination of logical, physical environment and cluster) as it + /// identifies unique deployment. + /// Multiple requests for the same combination of logical, physical + /// environment, cluster and deployment name will only create one + /// record, successive request will update the existing record. + /// This allows for a stable tracking of a deployment where the actual + /// deployed artifact can change over time. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)`. + func orgsCreateArtifactDeploymentRecord(_ input: Operations.OrgsCreateArtifactDeploymentRecord.Input) async throws -> Operations.OrgsCreateArtifactDeploymentRecord.Output + /// Set cluster deployment records + /// + /// Set deployment records for a given cluster. + /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', + /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. + /// If no existing records match, new records will be created. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. + func orgsSetClusterDeploymentRecords(_ input: Operations.OrgsSetClusterDeploymentRecords.Input) async throws -> Operations.OrgsSetClusterDeploymentRecords.Output /// Create artifact metadata storage record /// /// Create metadata storage records for artifacts associated with an organization. @@ -104,6 +104,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output + /// List artifact deployment records + /// + /// List deployment records for an artifact metadata associated with an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/get(orgs/list-artifact-deployment-records)`. + func orgsListArtifactDeploymentRecords(_ input: Operations.OrgsListArtifactDeploymentRecords.Input) async throws -> Operations.OrgsListArtifactDeploymentRecords.Output /// List artifact storage records /// /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. @@ -448,6 +455,49 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. func orgsListInvitationTeams(_ input: Operations.OrgsListInvitationTeams.Input) async throws -> Operations.OrgsListInvitationTeams.Output + /// List issue fields for an organization + /// + /// Lists all issue fields for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)`. + func orgsListIssueFields(_ input: Operations.OrgsListIssueFields.Input) async throws -> Operations.OrgsListIssueFields.Output + /// Create issue field for an organization + /// + /// Creates a new issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)`. + func orgsCreateIssueField(_ input: Operations.OrgsCreateIssueField.Input) async throws -> Operations.OrgsCreateIssueField.Output + /// Update issue field for an organization + /// + /// Updates an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)`. + func orgsUpdateIssueField(_ input: Operations.OrgsUpdateIssueField.Input) async throws -> Operations.OrgsUpdateIssueField.Output + /// Delete issue field for an organization + /// + /// Deletes an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)`. + func orgsDeleteIssueField(_ input: Operations.OrgsDeleteIssueField.Input) async throws -> Operations.OrgsDeleteIssueField.Output /// List issue types for an organization /// /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. @@ -1039,53 +1089,6 @@ extension APIProtocol { headers: headers )) } - /// Get all custom property values for an organization - /// - /// Gets all custom property values that are set for an organization. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope - /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above - /// - /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. - public func orgsCustomPropertiesForOrgsGetOrganizationValues( - path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path, - headers: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers = .init() - ) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output { - try await orgsCustomPropertiesForOrgsGetOrganizationValues(Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input( - path: path, - headers: headers - )) - } - /// Create or update custom property values for an organization - /// - /// Create new or update existing custom property values for an organization. - /// To remove a custom property value from an organization, set the property value to `null`. - /// - /// The organization must belong to an enterprise. - /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope - /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission - /// - /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. - public func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues( - path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path, - headers: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers = .init(), - body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body - ) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output { - try await orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input( - path: path, - headers: headers, - body: body - )) - } /// Get an organization /// /// Gets information about an organization. @@ -1157,6 +1160,55 @@ extension APIProtocol { headers: headers )) } + /// Create an artifact deployment record + /// + /// Create or update deployment records for an artifact associated + /// with an organization. + /// This endpoint allows you to record information about a specific + /// artifact, such as its name, digest, environments, cluster, and + /// deployment. + /// The deployment name has to be uniqe within a cluster (i.e a + /// combination of logical, physical environment and cluster) as it + /// identifies unique deployment. + /// Multiple requests for the same combination of logical, physical + /// environment, cluster and deployment name will only create one + /// record, successive request will update the existing record. + /// This allows for a stable tracking of a deployment where the actual + /// deployed artifact can change over time. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)`. + public func orgsCreateArtifactDeploymentRecord( + path: Operations.OrgsCreateArtifactDeploymentRecord.Input.Path, + headers: Operations.OrgsCreateArtifactDeploymentRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body + ) async throws -> Operations.OrgsCreateArtifactDeploymentRecord.Output { + try await orgsCreateArtifactDeploymentRecord(Operations.OrgsCreateArtifactDeploymentRecord.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set cluster deployment records + /// + /// Set deployment records for a given cluster. + /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', + /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. + /// If no existing records match, new records will be created. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. + public func orgsSetClusterDeploymentRecords( + path: Operations.OrgsSetClusterDeploymentRecords.Input.Path, + headers: Operations.OrgsSetClusterDeploymentRecords.Input.Headers = .init(), + body: Operations.OrgsSetClusterDeploymentRecords.Input.Body + ) async throws -> Operations.OrgsSetClusterDeploymentRecords.Output { + try await orgsSetClusterDeploymentRecords(Operations.OrgsSetClusterDeploymentRecords.Input( + path: path, + headers: headers, + body: body + )) + } /// Create artifact metadata storage record /// /// Create metadata storage records for artifacts associated with an organization. @@ -1176,6 +1228,21 @@ extension APIProtocol { body: body )) } + /// List artifact deployment records + /// + /// List deployment records for an artifact metadata associated with an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/get(orgs/list-artifact-deployment-records)`. + public func orgsListArtifactDeploymentRecords( + path: Operations.OrgsListArtifactDeploymentRecords.Input.Path, + headers: Operations.OrgsListArtifactDeploymentRecords.Input.Headers = .init() + ) async throws -> Operations.OrgsListArtifactDeploymentRecords.Output { + try await orgsListArtifactDeploymentRecords(Operations.OrgsListArtifactDeploymentRecords.Input( + path: path, + headers: headers + )) + } /// List artifact storage records /// /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. @@ -1860,6 +1927,85 @@ extension APIProtocol { headers: headers )) } + /// List issue fields for an organization + /// + /// Lists all issue fields for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)`. + public func orgsListIssueFields( + path: Operations.OrgsListIssueFields.Input.Path, + headers: Operations.OrgsListIssueFields.Input.Headers = .init() + ) async throws -> Operations.OrgsListIssueFields.Output { + try await orgsListIssueFields(Operations.OrgsListIssueFields.Input( + path: path, + headers: headers + )) + } + /// Create issue field for an organization + /// + /// Creates a new issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)`. + public func orgsCreateIssueField( + path: Operations.OrgsCreateIssueField.Input.Path, + headers: Operations.OrgsCreateIssueField.Input.Headers = .init(), + body: Operations.OrgsCreateIssueField.Input.Body + ) async throws -> Operations.OrgsCreateIssueField.Output { + try await orgsCreateIssueField(Operations.OrgsCreateIssueField.Input( + path: path, + headers: headers, + body: body + )) + } + /// Update issue field for an organization + /// + /// Updates an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)`. + public func orgsUpdateIssueField( + path: Operations.OrgsUpdateIssueField.Input.Path, + headers: Operations.OrgsUpdateIssueField.Input.Headers = .init(), + body: Operations.OrgsUpdateIssueField.Input.Body + ) async throws -> Operations.OrgsUpdateIssueField.Output { + try await orgsUpdateIssueField(Operations.OrgsUpdateIssueField.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete issue field for an organization + /// + /// Deletes an issue field for an organization. + /// + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)`. + public func orgsDeleteIssueField( + path: Operations.OrgsDeleteIssueField.Input.Path, + headers: Operations.OrgsDeleteIssueField.Input.Headers = .init() + ) async throws -> Operations.OrgsDeleteIssueField.Output { + try await orgsDeleteIssueField(Operations.OrgsDeleteIssueField.Input( + path: path, + headers: headers + )) + } /// List issue types for an organization /// /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. @@ -3214,8 +3360,8 @@ public enum Components { case case1(Swift.String) /// - Remark: Generated from `#/components/schemas/webhook-config-insecure-ssl/case2`. case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -3234,7 +3380,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -3466,8 +3612,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -3492,7 +3638,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -3634,10 +3780,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3658,10 +3804,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3703,10 +3849,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3832,6 +3978,28 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/administration`. public var administration: Components.Schemas.AppPermissions.AdministrationPayload? + /// The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/artifact_metadata`. + @frozen public enum ArtifactMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/artifact_metadata`. + public var artifactMetadata: Components.Schemas.AppPermissions.ArtifactMetadataPayload? + /// The level of permission to create and retrieve the access token for repository attestations. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/attestations`. + @frozen public enum AttestationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to create and retrieve the access token for repository attestations. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/attestations`. + public var attestations: Components.Schemas.AppPermissions.AttestationsPayload? /// The level of permission to grant the access token for checks on code. /// /// - Remark: Generated from `#/components/schemas/app-permissions/checks`. @@ -3887,6 +4055,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/deployments`. public var deployments: Components.Schemas.AppPermissions.DeploymentsPayload? + /// The level of permission to grant the access token for discussions and related comments and labels. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/discussions`. + @frozen public enum DiscussionsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token for discussions and related comments and labels. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/discussions`. + public var discussions: Components.Schemas.AppPermissions.DiscussionsPayload? /// The level of permission to grant the access token for managing repository environments. /// /// - Remark: Generated from `#/components/schemas/app-permissions/environments`. @@ -3909,6 +4088,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/issues`. public var issues: Components.Schemas.AppPermissions.IssuesPayload? + /// The level of permission to grant the access token to manage the merge queues for a repository. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/merge_queues`. + @frozen public enum MergeQueuesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to manage the merge queues for a repository. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/merge_queues`. + public var mergeQueues: Components.Schemas.AppPermissions.MergeQueuesPayload? /// The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. /// /// - Remark: Generated from `#/components/schemas/app-permissions/metadata`. @@ -4140,6 +4330,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. public var organizationCopilotSeatManagement: Components.Schemas.AppPermissions.OrganizationCopilotSeatManagementPayload? + /// The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_agent_settings`. + @frozen public enum OrganizationCopilotAgentSettingsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_agent_settings`. + public var organizationCopilotAgentSettings: Components.Schemas.AppPermissions.OrganizationCopilotAgentSettingsPayload? /// The level of permission to grant the access token to view and manage announcement banners for an organization. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_announcement_banners`. @@ -4260,17 +4461,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_user_blocking`. public var organizationUserBlocking: Components.Schemas.AppPermissions.OrganizationUserBlockingPayload? - /// The level of permission to grant the access token to manage team discussions and related comments. - /// - /// - Remark: Generated from `#/components/schemas/app-permissions/team_discussions`. - @frozen public enum TeamDiscussionsPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - } - /// The level of permission to grant the access token to manage team discussions and related comments. - /// - /// - Remark: Generated from `#/components/schemas/app-permissions/team_discussions`. - public var teamDiscussions: Components.Schemas.AppPermissions.TeamDiscussionsPayload? /// The level of permission to grant the access token to manage the email addresses belonging to a user. /// /// - Remark: Generated from `#/components/schemas/app-permissions/email_addresses`. @@ -4364,13 +4554,17 @@ public enum Components { /// - Parameters: /// - actions: The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. /// - administration: The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. + /// - artifactMetadata: The level of permission to grant the access token to create and retrieve build artifact metadata records. + /// - attestations: The level of permission to create and retrieve the access token for repository attestations. /// - checks: The level of permission to grant the access token for checks on code. /// - codespaces: The level of permission to grant the access token to create, edit, delete, and list Codespaces. /// - contents: The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. /// - dependabotSecrets: The level of permission to grant the access token to manage Dependabot secrets. /// - deployments: The level of permission to grant the access token for deployments and deployment statuses. + /// - discussions: The level of permission to grant the access token for discussions and related comments and labels. /// - environments: The level of permission to grant the access token for managing repository environments. /// - issues: The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. + /// - mergeQueues: The level of permission to grant the access token to manage the merge queues for a repository. /// - metadata: The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. /// - packages: The level of permission to grant the access token for packages published to GitHub Packages. /// - pages: The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. @@ -4392,6 +4586,7 @@ public enum Components { /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. + /// - organizationCopilotAgentSettings: The level of permission to grant the access token to view and manage Copilot coding agent settings for an organization. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. /// - organizationHooks: The level of permission to grant the access token to manage the post-receive hooks for an organization. @@ -4403,7 +4598,6 @@ public enum Components { /// - organizationSecrets: The level of permission to grant the access token to manage organization secrets. /// - organizationSelfHostedRunners: The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. /// - organizationUserBlocking: The level of permission to grant the access token to view and manage users blocked by the organization. - /// - teamDiscussions: The level of permission to grant the access token to manage team discussions and related comments. /// - emailAddresses: The level of permission to grant the access token to manage the email addresses belonging to a user. /// - followers: The level of permission to grant the access token to manage the followers belonging to a user. /// - gitSshKeys: The level of permission to grant the access token to manage git SSH keys. @@ -4415,13 +4609,17 @@ public enum Components { public init( actions: Components.Schemas.AppPermissions.ActionsPayload? = nil, administration: Components.Schemas.AppPermissions.AdministrationPayload? = nil, + artifactMetadata: Components.Schemas.AppPermissions.ArtifactMetadataPayload? = nil, + attestations: Components.Schemas.AppPermissions.AttestationsPayload? = nil, checks: Components.Schemas.AppPermissions.ChecksPayload? = nil, codespaces: Components.Schemas.AppPermissions.CodespacesPayload? = nil, contents: Components.Schemas.AppPermissions.ContentsPayload? = nil, dependabotSecrets: Components.Schemas.AppPermissions.DependabotSecretsPayload? = nil, deployments: Components.Schemas.AppPermissions.DeploymentsPayload? = nil, + discussions: Components.Schemas.AppPermissions.DiscussionsPayload? = nil, environments: Components.Schemas.AppPermissions.EnvironmentsPayload? = nil, issues: Components.Schemas.AppPermissions.IssuesPayload? = nil, + mergeQueues: Components.Schemas.AppPermissions.MergeQueuesPayload? = nil, metadata: Components.Schemas.AppPermissions.MetadataPayload? = nil, packages: Components.Schemas.AppPermissions.PackagesPayload? = nil, pages: Components.Schemas.AppPermissions.PagesPayload? = nil, @@ -4443,6 +4641,7 @@ public enum Components { organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? = nil, organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? = nil, organizationCopilotSeatManagement: Components.Schemas.AppPermissions.OrganizationCopilotSeatManagementPayload? = nil, + organizationCopilotAgentSettings: Components.Schemas.AppPermissions.OrganizationCopilotAgentSettingsPayload? = nil, organizationAnnouncementBanners: Components.Schemas.AppPermissions.OrganizationAnnouncementBannersPayload? = nil, organizationEvents: Components.Schemas.AppPermissions.OrganizationEventsPayload? = nil, organizationHooks: Components.Schemas.AppPermissions.OrganizationHooksPayload? = nil, @@ -4454,7 +4653,6 @@ public enum Components { organizationSecrets: Components.Schemas.AppPermissions.OrganizationSecretsPayload? = nil, organizationSelfHostedRunners: Components.Schemas.AppPermissions.OrganizationSelfHostedRunnersPayload? = nil, organizationUserBlocking: Components.Schemas.AppPermissions.OrganizationUserBlockingPayload? = nil, - teamDiscussions: Components.Schemas.AppPermissions.TeamDiscussionsPayload? = nil, emailAddresses: Components.Schemas.AppPermissions.EmailAddressesPayload? = nil, followers: Components.Schemas.AppPermissions.FollowersPayload? = nil, gitSshKeys: Components.Schemas.AppPermissions.GitSshKeysPayload? = nil, @@ -4466,13 +4664,17 @@ public enum Components { ) { self.actions = actions self.administration = administration + self.artifactMetadata = artifactMetadata + self.attestations = attestations self.checks = checks self.codespaces = codespaces self.contents = contents self.dependabotSecrets = dependabotSecrets self.deployments = deployments + self.discussions = discussions self.environments = environments self.issues = issues + self.mergeQueues = mergeQueues self.metadata = metadata self.packages = packages self.pages = pages @@ -4494,6 +4696,7 @@ public enum Components { self.organizationCustomOrgRoles = organizationCustomOrgRoles self.organizationCustomProperties = organizationCustomProperties self.organizationCopilotSeatManagement = organizationCopilotSeatManagement + self.organizationCopilotAgentSettings = organizationCopilotAgentSettings self.organizationAnnouncementBanners = organizationAnnouncementBanners self.organizationEvents = organizationEvents self.organizationHooks = organizationHooks @@ -4505,7 +4708,6 @@ public enum Components { self.organizationSecrets = organizationSecrets self.organizationSelfHostedRunners = organizationSelfHostedRunners self.organizationUserBlocking = organizationUserBlocking - self.teamDiscussions = teamDiscussions self.emailAddresses = emailAddresses self.followers = followers self.gitSshKeys = gitSshKeys @@ -4518,13 +4720,17 @@ public enum Components { public enum CodingKeys: String, CodingKey { case actions case administration + case artifactMetadata = "artifact_metadata" + case attestations case checks case codespaces case contents case dependabotSecrets = "dependabot_secrets" case deployments + case discussions case environments case issues + case mergeQueues = "merge_queues" case metadata case packages case pages @@ -4546,6 +4752,7 @@ public enum Components { case organizationCustomOrgRoles = "organization_custom_org_roles" case organizationCustomProperties = "organization_custom_properties" case organizationCopilotSeatManagement = "organization_copilot_seat_management" + case organizationCopilotAgentSettings = "organization_copilot_agent_settings" case organizationAnnouncementBanners = "organization_announcement_banners" case organizationEvents = "organization_events" case organizationHooks = "organization_hooks" @@ -4557,7 +4764,6 @@ public enum Components { case organizationSecrets = "organization_secrets" case organizationSelfHostedRunners = "organization_self_hosted_runners" case organizationUserBlocking = "organization_user_blocking" - case teamDiscussions = "team_discussions" case emailAddresses = "email_addresses" case followers case gitSshKeys = "git_ssh_keys" @@ -4739,8 +4945,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -4761,7 +4967,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -5302,6 +5508,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -5312,6 +5619,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -5319,7 +5629,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -5328,6 +5641,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -5337,6 +5653,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -5479,6 +5798,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -5614,10 +5948,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -5695,6 +6029,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -5784,6 +6121,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -5873,6 +6213,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -5963,6 +6306,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5986,72 +6332,6 @@ public enum Components { case customProperties = "custom_properties" } } - /// Custom property name and associated value - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value`. - public struct CustomPropertyValue: Codable, Hashable, Sendable { - /// The name of the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. - public var propertyName: Swift.String - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - public var value: Components.Schemas.CustomPropertyValue.ValuePayload? - /// Creates a new `CustomPropertyValue`. - /// - /// - Parameters: - /// - propertyName: The name of the property - /// - value: The value assigned to the property - public init( - propertyName: Swift.String, - value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil - ) { - self.propertyName = propertyName - self.value = value - } - public enum CodingKeys: String, CodingKey { - case propertyName = "property_name" - case value - } - } /// Organization Full /// /// - Remark: Generated from `#/components/schemas/organization-full`. @@ -6562,11 +6842,123 @@ public enum Components { case deployKeysEnabledForRepositories = "deploy_keys_enabled_for_repositories" } } - /// Groups of organization members that gives permissions on specified repositories. + /// Artifact Metadata Deployment Record /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct NullableTeamSimple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record`. + public struct ArtifactDeploymentRecord: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/logical_environment`. + public var logicalEnvironment: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/physical_environment`. + public var physicalEnvironment: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/cluster`. + public var cluster: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/deployment_name`. + public var deploymentName: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/tags`. + public struct TagsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `TagsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Swift.String] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/tags`. + public var tags: Components.Schemas.ArtifactDeploymentRecord.TagsPayload? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/RuntimeRisksPayload`. + @frozen public enum RuntimeRisksPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case criticalResource = "critical-resource" + case internetExposed = "internet-exposed" + case lateralMovement = "lateral-movement" + case sensitiveData = "sensitive-data" + } + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/runtime_risks`. + public typealias RuntimeRisksPayload = [Components.Schemas.ArtifactDeploymentRecord.RuntimeRisksPayloadPayload] + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/runtime_risks`. + public var runtimeRisks: Components.Schemas.ArtifactDeploymentRecord.RuntimeRisksPayload? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/updated_at`. + public var updatedAt: Swift.String? + /// The ID of the provenance attestation associated with the deployment record. + /// + /// - Remark: Generated from `#/components/schemas/artifact-deployment-record/attestation_id`. + public var attestationId: Swift.Int? + /// Creates a new `ArtifactDeploymentRecord`. + /// + /// - Parameters: + /// - id: + /// - digest: + /// - logicalEnvironment: + /// - physicalEnvironment: + /// - cluster: + /// - deploymentName: + /// - tags: + /// - runtimeRisks: A list of runtime risks associated with the deployment. + /// - createdAt: + /// - updatedAt: + /// - attestationId: The ID of the provenance attestation associated with the deployment record. + public init( + id: Swift.Int? = nil, + digest: Swift.String? = nil, + logicalEnvironment: Swift.String? = nil, + physicalEnvironment: Swift.String? = nil, + cluster: Swift.String? = nil, + deploymentName: Swift.String? = nil, + tags: Components.Schemas.ArtifactDeploymentRecord.TagsPayload? = nil, + runtimeRisks: Components.Schemas.ArtifactDeploymentRecord.RuntimeRisksPayload? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil, + attestationId: Swift.Int? = nil + ) { + self.id = id + self.digest = digest + self.logicalEnvironment = logicalEnvironment + self.physicalEnvironment = physicalEnvironment + self.cluster = cluster + self.deploymentName = deploymentName + self.tags = tags + self.runtimeRisks = runtimeRisks + self.createdAt = createdAt + self.updatedAt = updatedAt + self.attestationId = attestationId + } + public enum CodingKeys: String, CodingKey { + case id + case digest + case logicalEnvironment = "logical_environment" + case physicalEnvironment = "physical_environment" + case cluster + case deploymentName = "deployment_name" + case tags + case runtimeRisks = "runtime_risks" + case createdAt = "created_at" + case updatedAt = "updated_at" + case attestationId = "attestation_id" + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. public var id: Swift.Int @@ -7315,6 +7707,428 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/api-insights-user-stats`. public typealias ApiInsightsUserStats = [Components.Schemas.ApiInsightsUserStatsPayload] + /// A custom attribute defined at the organization level for attaching structured data to issues. + /// + /// - Remark: Generated from `#/components/schemas/issue-field`. + public struct IssueField: Codable, Hashable, Sendable { + /// The unique identifier of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/id`. + public var id: Swift.Int + /// The node identifier of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/node_id`. + public var nodeId: Swift.String + /// The name of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/name`. + public var name: Swift.String + /// The description of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/description`. + public var description: Swift.String? + /// The data type of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case date = "date" + case singleSelect = "single_select" + case number = "number" + } + /// The data type of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/data_type`. + public var dataType: Components.Schemas.IssueField.DataTypePayload + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). + /// + /// - Remark: Generated from `#/components/schemas/issue-field/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case organizationMembersOnly = "organization_members_only" + case all = "all" + } + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). + /// + /// - Remark: Generated from `#/components/schemas/issue-field/visibility`. + public var visibility: Components.Schemas.IssueField.VisibilityPayload? + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload`. + public struct OptionsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/id`. + public var id: Swift.Int + /// The name of the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/name`. + public var name: Swift.String + /// The description of the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/description`. + public var description: Swift.String? + /// The color of the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/color`. + public var color: Components.Schemas.IssueField.OptionsPayloadPayload.ColorPayload? + /// The priority of the option for ordering. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/priority`. + public var priority: Swift.Int? + /// The time the option was created. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/created_at`. + public var createdAt: Foundation.Date? + /// The time the option was last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/OptionsPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Creates a new `OptionsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the option. + /// - name: The name of the option. + /// - description: The description of the option. + /// - color: The color of the option. + /// - priority: The priority of the option for ordering. + /// - createdAt: The time the option was created. + /// - updatedAt: The time the option was last updated. + public init( + id: Swift.Int, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.IssueField.OptionsPayloadPayload.ColorPayload? = nil, + priority: Swift.Int? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil + ) { + self.id = id + self.name = name + self.description = description + self.color = color + self.priority = priority + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case color + case priority + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// Available options for single select fields. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/options`. + public typealias OptionsPayload = [Components.Schemas.IssueField.OptionsPayloadPayload] + /// Available options for single select fields. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/options`. + public var options: Components.Schemas.IssueField.OptionsPayload? + /// The time the issue field was created. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/created_at`. + public var createdAt: Foundation.Date? + /// The time the issue field was last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-field/updated_at`. + public var updatedAt: Foundation.Date? + /// Creates a new `IssueField`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue field. + /// - nodeId: The node identifier of the issue field. + /// - name: The name of the issue field. + /// - description: The description of the issue field. + /// - dataType: The data type of the issue field. + /// - visibility: The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). + /// - options: Available options for single select fields. + /// - createdAt: The time the issue field was created. + /// - updatedAt: The time the issue field was last updated. + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + dataType: Components.Schemas.IssueField.DataTypePayload, + visibility: Components.Schemas.IssueField.VisibilityPayload? = nil, + options: Components.Schemas.IssueField.OptionsPayload? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.description = description + self.dataType = dataType + self.visibility = visibility + self.options = options + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case description + case dataType = "data_type" + case visibility + case options + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field`. + public struct OrganizationCreateIssueField: Codable, Hashable, Sendable { + /// Name of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/name`. + public var name: Swift.String + /// Description of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/description`. + public var description: Swift.String? + /// The data type of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case date = "date" + case singleSelect = "single_select" + case number = "number" + } + /// The data type of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/data_type`. + public var dataType: Components.Schemas.OrganizationCreateIssueField.DataTypePayload + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. Defaults to `organization_members_only`. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case organizationMembersOnly = "organization_members_only" + case all = "all" + } + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. Defaults to `organization_members_only`. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/visibility`. + public var visibility: Components.Schemas.OrganizationCreateIssueField.VisibilityPayload? + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload`. + public struct OptionsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload/name`. + public var name: Swift.String + /// Description of the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload/description`. + public var description: Swift.String? + /// Color for the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// Color for the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload/color`. + public var color: Components.Schemas.OrganizationCreateIssueField.OptionsPayloadPayload.ColorPayload + /// Priority of the option for ordering. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/OptionsPayload/priority`. + public var priority: Swift.Int + /// Creates a new `OptionsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the option. + /// - description: Description of the option. + /// - color: Color for the option. + /// - priority: Priority of the option for ordering. + public init( + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.OrganizationCreateIssueField.OptionsPayloadPayload.ColorPayload, + priority: Swift.Int + ) { + self.name = name + self.description = description + self.color = color + self.priority = priority + } + public enum CodingKeys: String, CodingKey { + case name + case description + case color + case priority + } + } + /// Options for single select fields. Required when data_type is 'single_select'. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/options`. + public typealias OptionsPayload = [Components.Schemas.OrganizationCreateIssueField.OptionsPayloadPayload] + /// Options for single select fields. Required when data_type is 'single_select'. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-field/options`. + public var options: Components.Schemas.OrganizationCreateIssueField.OptionsPayload? + /// Creates a new `OrganizationCreateIssueField`. + /// + /// - Parameters: + /// - name: Name of the issue field. + /// - description: Description of the issue field. + /// - dataType: The data type of the issue field. + /// - visibility: The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. Defaults to `organization_members_only`. + /// - options: Options for single select fields. Required when data_type is 'single_select'. + public init( + name: Swift.String, + description: Swift.String? = nil, + dataType: Components.Schemas.OrganizationCreateIssueField.DataTypePayload, + visibility: Components.Schemas.OrganizationCreateIssueField.VisibilityPayload? = nil, + options: Components.Schemas.OrganizationCreateIssueField.OptionsPayload? = nil + ) { + self.name = name + self.description = description + self.dataType = dataType + self.visibility = visibility + self.options = options + } + public enum CodingKeys: String, CodingKey { + case name + case description + case dataType = "data_type" + case visibility + case options + } + } + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field`. + public struct OrganizationUpdateIssueField: Codable, Hashable, Sendable { + /// Name of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/name`. + public var name: Swift.String? + /// Description of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/description`. + public var description: Swift.String? + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case organizationMembersOnly = "organization_members_only" + case all = "all" + } + /// The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/visibility`. + public var visibility: Components.Schemas.OrganizationUpdateIssueField.VisibilityPayload? + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload`. + public struct OptionsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload/name`. + public var name: Swift.String + /// Description of the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload/description`. + public var description: Swift.String? + /// Color for the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// Color for the option. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload/color`. + public var color: Components.Schemas.OrganizationUpdateIssueField.OptionsPayloadPayload.ColorPayload + /// Priority of the option for ordering. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/OptionsPayload/priority`. + public var priority: Swift.Int + /// Creates a new `OptionsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the option. + /// - description: Description of the option. + /// - color: Color for the option. + /// - priority: Priority of the option for ordering. + public init( + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.OrganizationUpdateIssueField.OptionsPayloadPayload.ColorPayload, + priority: Swift.Int + ) { + self.name = name + self.description = description + self.color = color + self.priority = priority + } + public enum CodingKeys: String, CodingKey { + case name + case description + case color + case priority + } + } + /// Options for single select fields. Only applicable when updating single_select fields. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/options`. + public typealias OptionsPayload = [Components.Schemas.OrganizationUpdateIssueField.OptionsPayloadPayload] + /// Options for single select fields. Only applicable when updating single_select fields. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-field/options`. + public var options: Components.Schemas.OrganizationUpdateIssueField.OptionsPayload? + /// Creates a new `OrganizationUpdateIssueField`. + /// + /// - Parameters: + /// - name: Name of the issue field. + /// - description: Description of the issue field. + /// - visibility: The visibility of the issue field. Can be `organization_members_only` (visible only within the organization) or `all` (visible to all users who can see issues). Only used when the visibility settings feature is enabled. + /// - options: Options for single select fields. Only applicable when updating single_select fields. + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + visibility: Components.Schemas.OrganizationUpdateIssueField.VisibilityPayload? = nil, + options: Components.Schemas.OrganizationUpdateIssueField.OptionsPayload? = nil + ) { + self.name = name + self.description = description + self.visibility = visibility + self.options = options + } + public enum CodingKeys: String, CodingKey { + case name + case description + case visibility + case options + } + } /// - Remark: Generated from `#/components/schemas/organization-create-issue-type`. public struct OrganizationCreateIssueType: Codable, Hashable, Sendable { /// Name of the issue type. @@ -8171,10 +8985,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8191,10 +9005,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8211,10 +9025,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8367,10 +9181,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8387,10 +9201,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8407,10 +9221,10 @@ public enum Components { public init(additionalProperties: [String: Swift.String] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -8549,6 +9363,7 @@ public enum Components { case singleSelect = "single_select" case multiSelect = "multi_select" case trueFalse = "true_false" + case url = "url" } /// The type of the value for the property /// @@ -8566,8 +9381,8 @@ public enum Components { case case1(Swift.String) /// - Remark: Generated from `#/components/schemas/custom-property/default_value/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -8586,7 +9401,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -8619,6 +9434,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/custom-property/values_editable_by`. public var valuesEditableBy: Components.Schemas.CustomProperty.ValuesEditableByPayload? + /// Whether setting properties values is mandatory + /// + /// - Remark: Generated from `#/components/schemas/custom-property/require_explicit_values`. + public var requireExplicitValues: Swift.Bool? /// Creates a new `CustomProperty`. /// /// - Parameters: @@ -8631,6 +9450,7 @@ public enum Components { /// - description: Short description of the property /// - allowedValues: An ordered list of the allowed values of the property. /// - valuesEditableBy: Who can edit the values of the property + /// - requireExplicitValues: Whether setting properties values is mandatory public init( propertyName: Swift.String, url: Swift.String? = nil, @@ -8640,7 +9460,8 @@ public enum Components { defaultValue: Components.Schemas.CustomProperty.DefaultValuePayload? = nil, description: Swift.String? = nil, allowedValues: [Swift.String]? = nil, - valuesEditableBy: Components.Schemas.CustomProperty.ValuesEditableByPayload? = nil + valuesEditableBy: Components.Schemas.CustomProperty.ValuesEditableByPayload? = nil, + requireExplicitValues: Swift.Bool? = nil ) { self.propertyName = propertyName self.url = url @@ -8651,6 +9472,7 @@ public enum Components { self.description = description self.allowedValues = allowedValues self.valuesEditableBy = valuesEditableBy + self.requireExplicitValues = requireExplicitValues } public enum CodingKeys: String, CodingKey { case propertyName = "property_name" @@ -8662,6 +9484,7 @@ public enum Components { case description case allowedValues = "allowed_values" case valuesEditableBy = "values_editable_by" + case requireExplicitValues = "require_explicit_values" } } /// Custom property set payload @@ -8676,6 +9499,7 @@ public enum Components { case singleSelect = "single_select" case multiSelect = "multi_select" case trueFalse = "true_false" + case url = "url" } /// The type of the value for the property /// @@ -8693,8 +9517,8 @@ public enum Components { case case1(Swift.String) /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/default_value/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -8713,7 +9537,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -8746,6 +9570,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/values_editable_by`. public var valuesEditableBy: Components.Schemas.CustomPropertySetPayload.ValuesEditableByPayload? + /// Whether setting properties values is mandatory + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/require_explicit_values`. + public var requireExplicitValues: Swift.Bool? /// Creates a new `CustomPropertySetPayload`. /// /// - Parameters: @@ -8755,13 +9583,15 @@ public enum Components { /// - description: Short description of the property /// - allowedValues: An ordered list of the allowed values of the property. /// - valuesEditableBy: Who can edit the values of the property + /// - requireExplicitValues: Whether setting properties values is mandatory public init( valueType: Components.Schemas.CustomPropertySetPayload.ValueTypePayload, required: Swift.Bool? = nil, defaultValue: Components.Schemas.CustomPropertySetPayload.DefaultValuePayload? = nil, description: Swift.String? = nil, allowedValues: [Swift.String]? = nil, - valuesEditableBy: Components.Schemas.CustomPropertySetPayload.ValuesEditableByPayload? = nil + valuesEditableBy: Components.Schemas.CustomPropertySetPayload.ValuesEditableByPayload? = nil, + requireExplicitValues: Swift.Bool? = nil ) { self.valueType = valueType self.required = required @@ -8769,6 +9599,7 @@ public enum Components { self.description = description self.allowedValues = allowedValues self.valuesEditableBy = valuesEditableBy + self.requireExplicitValues = requireExplicitValues } public enum CodingKeys: String, CodingKey { case valueType = "value_type" @@ -8777,6 +9608,73 @@ public enum Components { case description case allowedValues = "allowed_values" case valuesEditableBy = "values_editable_by" + case requireExplicitValues = "require_explicit_values" + } + } + /// Custom property name and associated value + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value`. + public struct CustomPropertyValue: Codable, Hashable, Sendable { + /// The name of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. + public var propertyName: Swift.String + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + public var value: Components.Schemas.CustomPropertyValue.ValuePayload? + /// Creates a new `CustomPropertyValue`. + /// + /// - Parameters: + /// - propertyName: The name of the property + /// - value: The value assigned to the property + public init( + propertyName: Swift.String, + value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil + ) { + self.propertyName = propertyName + self.value = value + } + public enum CodingKeys: String, CodingKey { + case propertyName = "property_name" + case value } } /// List of custom property values for a repository @@ -8913,11 +9811,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -9011,6 +9909,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias RepositoryId = Swift.Int + /// The SHA256 digest of the artifact, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/components/parameters/subject-digest`. + public typealias SubjectDigest = Swift.String /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -9086,6 +9988,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/invitation-id`. public typealias InvitationId = Swift.Int + /// The unique identifier of the issue field. + /// + /// - Remark: Generated from `#/components/parameters/issue-field-id`. + public typealias IssueFieldId = Swift.Int /// The unique identifier of the issue type. /// /// - Remark: Generated from `#/components/parameters/issue-type-id`. @@ -9647,27 +10553,28 @@ public enum Operations { } } } - /// Get all custom property values for an organization + /// Get an organization + /// + /// Gets information about an organization. + /// + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). /// - /// Gets all custom property values that are set for an organization. + /// To see the full details about an organization, the authenticated user must be an organization owner. /// - /// The organization must belong to an enterprise. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope - /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above + /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. /// - /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. - public enum OrgsCustomPropertiesForOrgsGetOrganizationValues { - public static let id: Swift.String = "orgs/custom-properties-for-orgs-get-organization-values" + /// - Remark: HTTP `GET /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)`. + public enum OrgsGet { + public static let id: Swift.String = "orgs/get" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -9677,27 +10584,27 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/header`. + public var path: Operations.OrgsGet.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/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.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers + public var headers: Operations.OrgsGet.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path, - headers: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers = .init() + path: Operations.OrgsGet.Input.Path, + headers: Operations.OrgsGet.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -9705,15 +10612,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/responses/200/content/application\/json`. - case json([Components.Schemas.CustomPropertyValue]) + /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationFull) /// 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.CustomPropertyValue] { + public var json: Components.Schemas.OrganizationFull { get throws { switch self { case let .json(body): @@ -9723,26 +10630,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok.Body + public var body: Operations.OrgsGet.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok.Body) { + public init(body: Operations.OrgsGet.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok) + case ok(Operations.OrgsGet.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.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok { + public var ok: Operations.OrgsGet.Output.Ok { get throws { switch self { case let .ok(response): @@ -9755,32 +10662,9 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/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}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -9832,28 +10716,30 @@ public enum Operations { } } } - /// Create or update custom property values for an organization + /// Update an organization + /// + /// > [!WARNING] + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// - /// Create new or update existing custom property values for an organization. - /// To remove a custom property value from an organization, set the property value to `null`. + /// > [!WARNING] + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// + /// Updates the organization's profile and member privileges. /// - /// The organization must belong to an enterprise. + /// The authenticated user must be an organization owner to use this endpoint. /// - /// Access requirements: - /// - Organization admins - /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope - /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. - public enum OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues { - public static let id: Swift.String = "orgs/custom-properties-for-orgs-create-or-update-organization-values" + /// - Remark: HTTP `PATCH /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)`. + public enum OrgsUpdate { + public static let id: Swift.String = "orgs/update" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -9863,175 +10749,680 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/header`. + public var path: Operations.OrgsUpdate.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/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.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody`. + public var headers: Operations.OrgsUpdate.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// A list of custom property names and associated values to apply to the organization. + /// Billing email address. This address is not publicized. /// - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/json/properties`. - public var properties: [Components.Schemas.CustomPropertyValue] - /// Creates a new `JsonPayload`. + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/billing_email`. + public var billingEmail: Swift.String? + /// The company name. /// - /// - Parameters: - /// - properties: A list of custom property names and associated values to apply to the organization. - public init(properties: [Components.Schemas.CustomPropertyValue]) { - self.properties = properties - } - public enum CodingKeys: String, CodingKey { - case properties - } - } - /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body.JsonPayload) - } - public var body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path, - headers: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers = .init(), - body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.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 when custom property values are successfully created or updated - /// - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output.NoContent) - /// No Content when custom property values are successfully created or updated - /// - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/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.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.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}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/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}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/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}/PATCH/requestBody/json/company`. + public var company: Swift.String? + /// The publicly visible email address. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/email`. + public var email: Swift.String? + /// The Twitter username of the company. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/twitter_username`. + public var twitterUsername: Swift.String? + /// The location. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/location`. + public var location: Swift.String? + /// The shorthand name of the company. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The description of the company. The maximum size is 160 characters. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// Whether an organization can use organization projects. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_organization_projects`. + public var hasOrganizationProjects: Swift.Bool? + /// Whether repositories that belong to the organization can use repository projects. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_repository_projects`. + public var hasRepositoryProjects: Swift.Bool? + /// Default permission level members have for organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. + @frozen public enum DefaultRepositoryPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/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 - ) + /// Default permission level members have for organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. + public var defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? + /// Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_repositories`. + public var membersCanCreateRepositories: Swift.Bool? + /// Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_internal_repositories`. + public var membersCanCreateInternalRepositories: Swift.Bool? + /// Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_repositories`. + public var membersCanCreatePrivateRepositories: Swift.Bool? + /// Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_repositories`. + public var membersCanCreatePublicRepositories: Swift.Bool? + /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. + @frozen public enum MembersAllowedRepositoryCreationTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case none = "none" } - } - } - /// 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 + /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. + public var membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? + /// Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_pages`. + public var membersCanCreatePages: Swift.Bool? + /// Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_pages`. + public var membersCanCreatePublicPages: Swift.Bool? + /// Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_pages`. + public var membersCanCreatePrivatePages: Swift.Bool? + /// Whether organization members can fork private organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_fork_private_repositories`. + public var membersCanForkPrivateRepositories: Swift.Bool? + /// Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/blog`. + public var blog: Swift.String? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/advanced_security_enabled_for_new_repositories`. + @available(*, deprecated) + public var advancedSecurityEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_alerts_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependabotAlertsEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_security_updates_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependency_graph_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependencyGraphEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_enabled_for_new_repositories`. + @available(*, deprecated) + public var secretScanningEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_enabled_for_new_repositories`. + @available(*, deprecated) + public var secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? + /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link_enabled`. + public var secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? + /// If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link`. + public var secretScanningPushProtectionCustomLink: Swift.String? + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/deploy_keys_enabled_for_repositories`. + public var deployKeysEnabledForRepositories: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - billingEmail: Billing email address. This address is not publicized. + /// - company: The company name. + /// - email: The publicly visible email address. + /// - twitterUsername: The Twitter username of the company. + /// - location: The location. + /// - name: The shorthand name of the company. + /// - description: The description of the company. The maximum size is 160 characters. + /// - hasOrganizationProjects: Whether an organization can use organization projects. + /// - hasRepositoryProjects: Whether repositories that belong to the organization can use repository projects. + /// - defaultRepositoryPermission: Default permission level members have for organization repositories. + /// - membersCanCreateRepositories: Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + /// - membersCanCreateInternalRepositories: Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersCanCreatePrivateRepositories: Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersCanCreatePublicRepositories: Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersAllowedRepositoryCreationType: Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// - membersCanCreatePages: Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanCreatePublicPages: Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanCreatePrivatePages: Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanForkPrivateRepositories: Whether organization members can fork private organization repositories. + /// - webCommitSignoffRequired: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + /// - blog: + /// - advancedSecurityEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabotAlertsEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabotSecurityUpdatesEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependencyGraphEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningPushProtectionEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningPushProtectionCustomLinkEnabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// - secretScanningPushProtectionCustomLink: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// - deployKeysEnabledForRepositories: Controls whether or not deploy keys may be added and used for repositories in the organization. + public init( + billingEmail: Swift.String? = nil, + company: Swift.String? = nil, + email: Swift.String? = nil, + twitterUsername: Swift.String? = nil, + location: Swift.String? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + hasOrganizationProjects: Swift.Bool? = nil, + hasRepositoryProjects: Swift.Bool? = nil, + defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? = nil, + membersCanCreateRepositories: Swift.Bool? = nil, + membersCanCreateInternalRepositories: Swift.Bool? = nil, + membersCanCreatePrivateRepositories: Swift.Bool? = nil, + membersCanCreatePublicRepositories: Swift.Bool? = nil, + membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? = nil, + membersCanCreatePages: Swift.Bool? = nil, + membersCanCreatePublicPages: Swift.Bool? = nil, + membersCanCreatePrivatePages: Swift.Bool? = nil, + membersCanForkPrivateRepositories: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + blog: Swift.String? = nil, + advancedSecurityEnabledForNewRepositories: Swift.Bool? = nil, + dependabotAlertsEnabledForNewRepositories: Swift.Bool? = nil, + dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? = nil, + dependencyGraphEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? = nil, + secretScanningPushProtectionCustomLink: Swift.String? = nil, + deployKeysEnabledForRepositories: Swift.Bool? = nil + ) { + self.billingEmail = billingEmail + self.company = company + self.email = email + self.twitterUsername = twitterUsername + self.location = location + self.name = name + self.description = description + self.hasOrganizationProjects = hasOrganizationProjects + self.hasRepositoryProjects = hasRepositoryProjects + self.defaultRepositoryPermission = defaultRepositoryPermission + self.membersCanCreateRepositories = membersCanCreateRepositories + self.membersCanCreateInternalRepositories = membersCanCreateInternalRepositories + self.membersCanCreatePrivateRepositories = membersCanCreatePrivateRepositories + self.membersCanCreatePublicRepositories = membersCanCreatePublicRepositories + self.membersAllowedRepositoryCreationType = membersAllowedRepositoryCreationType + self.membersCanCreatePages = membersCanCreatePages + self.membersCanCreatePublicPages = membersCanCreatePublicPages + self.membersCanCreatePrivatePages = membersCanCreatePrivatePages + self.membersCanForkPrivateRepositories = membersCanForkPrivateRepositories + self.webCommitSignoffRequired = webCommitSignoffRequired + self.blog = blog + self.advancedSecurityEnabledForNewRepositories = advancedSecurityEnabledForNewRepositories + self.dependabotAlertsEnabledForNewRepositories = dependabotAlertsEnabledForNewRepositories + self.dependabotSecurityUpdatesEnabledForNewRepositories = dependabotSecurityUpdatesEnabledForNewRepositories + self.dependencyGraphEnabledForNewRepositories = dependencyGraphEnabledForNewRepositories + self.secretScanningEnabledForNewRepositories = secretScanningEnabledForNewRepositories + self.secretScanningPushProtectionEnabledForNewRepositories = secretScanningPushProtectionEnabledForNewRepositories + self.secretScanningPushProtectionCustomLinkEnabled = secretScanningPushProtectionCustomLinkEnabled + self.secretScanningPushProtectionCustomLink = secretScanningPushProtectionCustomLink + self.deployKeysEnabledForRepositories = deployKeysEnabledForRepositories + } + public enum CodingKeys: String, CodingKey { + case billingEmail = "billing_email" + case company + case email + case twitterUsername = "twitter_username" + case location + case name + case description + case hasOrganizationProjects = "has_organization_projects" + case hasRepositoryProjects = "has_repository_projects" + case defaultRepositoryPermission = "default_repository_permission" + case membersCanCreateRepositories = "members_can_create_repositories" + case membersCanCreateInternalRepositories = "members_can_create_internal_repositories" + case membersCanCreatePrivateRepositories = "members_can_create_private_repositories" + case membersCanCreatePublicRepositories = "members_can_create_public_repositories" + case membersAllowedRepositoryCreationType = "members_allowed_repository_creation_type" + case membersCanCreatePages = "members_can_create_pages" + case membersCanCreatePublicPages = "members_can_create_public_pages" + case membersCanCreatePrivatePages = "members_can_create_private_pages" + case membersCanForkPrivateRepositories = "members_can_fork_private_repositories" + case webCommitSignoffRequired = "web_commit_signoff_required" + case blog + case advancedSecurityEnabledForNewRepositories = "advanced_security_enabled_for_new_repositories" + case dependabotAlertsEnabledForNewRepositories = "dependabot_alerts_enabled_for_new_repositories" + case dependabotSecurityUpdatesEnabledForNewRepositories = "dependabot_security_updates_enabled_for_new_repositories" + case dependencyGraphEnabledForNewRepositories = "dependency_graph_enabled_for_new_repositories" + case secretScanningEnabledForNewRepositories = "secret_scanning_enabled_for_new_repositories" + case secretScanningPushProtectionEnabledForNewRepositories = "secret_scanning_push_protection_enabled_for_new_repositories" + case secretScanningPushProtectionCustomLinkEnabled = "secret_scanning_push_protection_custom_link_enabled" + case secretScanningPushProtectionCustomLink = "secret_scanning_push_protection_custom_link" + case deployKeysEnabledForRepositories = "deploy_keys_enabled_for_repositories" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdate.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdate.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsUpdate.Input.Path, + headers: Operations.OrgsUpdate.Input.Headers = .init(), + body: Operations.OrgsUpdate.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationFull) + /// 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.OrganizationFull { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdate.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsUpdate.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.OrgsUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case1`. + case ValidationError(Components.Schemas.ValidationError) + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case2`. + case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .ValidationError(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ValidationErrorSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .ValidationError(value): + try value.encode(to: encoder) + case let .ValidationErrorSimple(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/application\/json`. + case json(Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdate.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdate.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OrgsUpdate.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OrgsUpdate.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an organization + /// + /// Deletes an organization and all its repositories. + /// + /// The organization login will be unavailable for 90 days after deletion. + /// + /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// + /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// + /// - Remark: HTTP `DELETE /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. + public enum OrgsDelete { + public static let id: Swift.String = "orgs/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsDelete.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDelete.Input.Path, + headers: Operations.OrgsDelete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json default: self = .other(rawValue) } @@ -10051,74 +11442,602 @@ public enum Operations { } } } - /// Get an organization - /// - /// Gets information about an organization. - /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). - /// - /// To see the full details about an organization, the authenticated user must be an organization owner. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. + /// Create an artifact deployment record + /// + /// Create or update deployment records for an artifact associated + /// with an organization. + /// This endpoint allows you to record information about a specific + /// artifact, such as its name, digest, environments, cluster, and + /// deployment. + /// The deployment name has to be uniqe within a cluster (i.e a + /// combination of logical, physical environment and cluster) as it + /// identifies unique deployment. + /// Multiple requests for the same combination of logical, physical + /// environment, cluster and deployment name will only create one + /// record, successive request will update the existing record. + /// This allows for a stable tracking of a deployment where the actual + /// deployed artifact can change over time. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)`. + public enum OrgsCreateArtifactDeploymentRecord { + public static let id: Swift.String = "orgs/create-artifact-deployment-record" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsCreateArtifactDeploymentRecord.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsCreateArtifactDeploymentRecord.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/name`. + public var name: Swift.String + /// The hex encoded digest of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/digest`. + public var digest: Swift.String + /// The artifact version. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/version`. + public var version: Swift.String? + /// The status of the artifact. Can be either deployed or decommissioned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case deployed = "deployed" + case decommissioned = "decommissioned" + } + /// The status of the artifact. Can be either deployed or decommissioned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/status`. + public var status: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.StatusPayload + /// The stage of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/logical_environment`. + public var logicalEnvironment: Swift.String + /// The physical region of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/physical_environment`. + public var physicalEnvironment: Swift.String? + /// The deployment cluster. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/cluster`. + public var cluster: Swift.String? + /// The unique identifier for the deployment represented by the new record. To accommodate differing + /// containers and namespaces within a cluster, the following format is recommended: + /// {namespaceName}-{deploymentName}-{containerName}. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/deployment_name`. + public var deploymentName: Swift.String + /// The tags associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/tags`. + public struct TagsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `TagsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Swift.String] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The tags associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/tags`. + public var tags: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.TagsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/RuntimeRisksPayload`. + @frozen public enum RuntimeRisksPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case criticalResource = "critical-resource" + case internetExposed = "internet-exposed" + case lateralMovement = "lateral-movement" + case sensitiveData = "sensitive-data" + } + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/runtime_risks`. + public typealias RuntimeRisksPayload = [Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.RuntimeRisksPayloadPayload] + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/runtime_risks`. + public var runtimeRisks: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.RuntimeRisksPayload? + /// The name of the GitHub repository associated with the artifact. This should be used + /// when there are no provenance attestations available for the artifact. The repository + /// must belong to the organization specified in the path parameter. + /// + /// If a provenance attestation is available for the artifact, the API will use + /// the repository information from the attestation instead of this parameter. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/github_repository`. + public var githubRepository: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. + /// - digest: The hex encoded digest of the artifact. + /// - version: The artifact version. + /// - status: The status of the artifact. Can be either deployed or decommissioned. + /// - logicalEnvironment: The stage of the deployment. + /// - physicalEnvironment: The physical region of the deployment. + /// - cluster: The deployment cluster. + /// - deploymentName: The unique identifier for the deployment represented by the new record. To accommodate differing + /// - tags: The tags associated with the deployment. + /// - runtimeRisks: A list of runtime risks associated with the deployment. + /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used + public init( + name: Swift.String, + digest: Swift.String, + version: Swift.String? = nil, + status: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.StatusPayload, + logicalEnvironment: Swift.String, + physicalEnvironment: Swift.String? = nil, + cluster: Swift.String? = nil, + deploymentName: Swift.String, + tags: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.TagsPayload? = nil, + runtimeRisks: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.RuntimeRisksPayload? = nil, + githubRepository: Swift.String? = nil + ) { + self.name = name + self.digest = digest + self.version = version + self.status = status + self.logicalEnvironment = logicalEnvironment + self.physicalEnvironment = physicalEnvironment + self.cluster = cluster + self.deploymentName = deploymentName + self.tags = tags + self.runtimeRisks = runtimeRisks + self.githubRepository = githubRepository + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case version + case status + case logicalEnvironment = "logical_environment" + case physicalEnvironment = "physical_environment" + case cluster + case deploymentName = "deployment_name" + case tags + case runtimeRisks = "runtime_risks" + case githubRepository = "github_repository" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCreateArtifactDeploymentRecord.Input.Path, + headers: Operations.OrgsCreateArtifactDeploymentRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactDeploymentRecord.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}/artifacts/metadata/deployment-record/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of deployment records created + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/json/deployment_records`. + public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of deployment records created + /// - deploymentRecords: + public init( + totalCount: Swift.Int? = nil, + deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil + ) { + self.totalCount = totalCount + self.deploymentRecords = deploymentRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case deploymentRecords = "deployment_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/application\/json`. + case json(Operations.OrgsCreateArtifactDeploymentRecord.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.OrgsCreateArtifactDeploymentRecord.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateArtifactDeploymentRecord.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateArtifactDeploymentRecord.Output.Ok.Body) { + self.body = body + } + } + /// Artifact deployment record stored successfully. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCreateArtifactDeploymentRecord.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.OrgsCreateArtifactDeploymentRecord.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set cluster deployment records /// - /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. + /// Set deployment records for a given cluster. + /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', + /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. + /// If no existing records match, new records will be created. /// - /// - Remark: HTTP `GET /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)`. - public enum OrgsGet { - public static let id: Swift.String = "orgs/get" + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. + public enum OrgsSetClusterDeploymentRecords { + public static let id: Swift.String = "orgs/set-cluster-deployment-records" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/path/org`. public var org: Components.Parameters.Org + /// The cluster name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/path/cluster`. + public var cluster: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - cluster: The cluster name. + public init( + org: Components.Parameters.Org, + cluster: Swift.String + ) { self.org = org + self.cluster = cluster } } - public var path: Operations.OrgsGet.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/GET/header`. + public var path: Operations.OrgsSetClusterDeploymentRecords.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/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.OrgsGet.Input.Headers + public var headers: Operations.OrgsSetClusterDeploymentRecords.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The stage of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/logical_environment`. + public var logicalEnvironment: Swift.String + /// The physical region of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/physical_environment`. + public var physicalEnvironment: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload`. + public struct DeploymentsPayloadPayload: Codable, Hashable, Sendable { + /// The name of the artifact. Note that if multiple deployments have identical 'digest' parameter values, + /// the name parameter must also be identical across all entries. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/name`. + public var name: Swift.String + /// The hex encoded digest of the artifact. Note that if multiple deployments have identical 'digest' parameter values, + /// the name and version parameters must also be identical across all entries. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/digest`. + public var digest: Swift.String + /// The artifact version. Note that if multiple deployments have identical 'digest' parameter values, + /// the version parameter must also be identical across all entries. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/version`. + public var version: Swift.String? + /// The deployment status of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case deployed = "deployed" + case decommissioned = "decommissioned" + } + /// The deployment status of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/status`. + public var status: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.StatusPayload? + /// The unique identifier for the deployment represented by the new record. To accommodate differing + /// containers and namespaces within a record set, the following format is recommended: + /// {namespaceName}-{deploymentName}-{containerName}. + /// The deployment_name must be unique across all entries in the deployments array. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/deployment_name`. + public var deploymentName: Swift.String + /// The name of the GitHub repository associated with the artifact. This should be used + /// when there are no provenance attestations available for the artifact. The repository + /// must belong to the organization specified in the path parameter. + /// + /// If a provenance attestation is available for the artifact, the API will use + /// the repository information from the attestation instead of this parameter. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/github_repository`. + public var githubRepository: Swift.String? + /// Key-value pairs to tag the deployment record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/tags`. + public struct TagsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `TagsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Swift.String] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Key-value pairs to tag the deployment record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/tags`. + public var tags: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.TagsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/RuntimeRisksPayload`. + @frozen public enum RuntimeRisksPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case criticalResource = "critical-resource" + case internetExposed = "internet-exposed" + case lateralMovement = "lateral-movement" + case sensitiveData = "sensitive-data" + } + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/runtime_risks`. + public typealias RuntimeRisksPayload = [Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayloadPayload] + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/runtime_risks`. + public var runtimeRisks: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayload? + /// Creates a new `DeploymentsPayloadPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. Note that if multiple deployments have identical 'digest' parameter values, + /// - digest: The hex encoded digest of the artifact. Note that if multiple deployments have identical 'digest' parameter values, + /// - version: The artifact version. Note that if multiple deployments have identical 'digest' parameter values, + /// - status: The deployment status of the artifact. + /// - deploymentName: The unique identifier for the deployment represented by the new record. To accommodate differing + /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used + /// - tags: Key-value pairs to tag the deployment record. + /// - runtimeRisks: A list of runtime risks associated with the deployment. + public init( + name: Swift.String, + digest: Swift.String, + version: Swift.String? = nil, + status: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.StatusPayload? = nil, + deploymentName: Swift.String, + githubRepository: Swift.String? = nil, + tags: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.TagsPayload? = nil, + runtimeRisks: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayload? = nil + ) { + self.name = name + self.digest = digest + self.version = version + self.status = status + self.deploymentName = deploymentName + self.githubRepository = githubRepository + self.tags = tags + self.runtimeRisks = runtimeRisks + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case version + case status + case deploymentName = "deployment_name" + case githubRepository = "github_repository" + case tags + case runtimeRisks = "runtime_risks" + } + } + /// The list of deployments to record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/deployments`. + public typealias DeploymentsPayload = [Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayloadPayload] + /// The list of deployments to record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/deployments`. + public var deployments: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - logicalEnvironment: The stage of the deployment. + /// - physicalEnvironment: The physical region of the deployment. + /// - deployments: The list of deployments to record. + public init( + logicalEnvironment: Swift.String, + physicalEnvironment: Swift.String? = nil, + deployments: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayload + ) { + self.logicalEnvironment = logicalEnvironment + self.physicalEnvironment = physicalEnvironment + self.deployments = deployments + } + public enum CodingKeys: String, CodingKey { + case logicalEnvironment = "logical_environment" + case physicalEnvironment = "physical_environment" + case deployments + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/content/application\/json`. + case json(Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload) + } + public var body: Operations.OrgsSetClusterDeploymentRecords.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsGet.Input.Path, - headers: Operations.OrgsGet.Input.Headers = .init() + path: Operations.OrgsSetClusterDeploymentRecords.Input.Path, + headers: Operations.OrgsSetClusterDeploymentRecords.Input.Headers = .init(), + body: Operations.OrgsSetClusterDeploymentRecords.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}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationFull) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of deployment records created + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/deployment_records`. + public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of deployment records created + /// - deploymentRecords: + public init( + totalCount: Swift.Int? = nil, + deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil + ) { + self.totalCount = totalCount + self.deploymentRecords = deploymentRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case deploymentRecords = "deployment_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/application\/json`. + case json(Operations.OrgsSetClusterDeploymentRecords.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.OrganizationFull { + public var json: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -10128,26 +12047,27 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGet.Output.Ok.Body + public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGet.Output.Ok.Body) { + public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body) { self.body = body } } - /// Response + /// Deployment records created or updated successfully. /// - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/200`. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGet.Output.Ok) + case ok(Operations.OrgsSetClusterDeploymentRecords.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.OrgsGet.Output.Ok { + public var ok: Operations.OrgsSetClusterDeploymentRecords.Output.Ok { get throws { switch self { case let .ok(response): @@ -10160,29 +12080,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/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. @@ -10214,30 +12111,22 @@ public enum Operations { } } } - /// Update an organization - /// - /// > [!WARNING] - /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). - /// - /// > [!WARNING] - /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). - /// - /// Updates the organization's profile and member privileges. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// Create artifact metadata storage record /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)`. - public enum OrgsUpdate { - public static let id: Swift.String = "orgs/update" + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public enum OrgsCreateArtifactStorageRecord { + public static let id: Swift.String = "orgs/create-artifact-storage-record" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -10247,362 +12136,238 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsUpdate.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/header`. + public var path: Operations.OrgsCreateArtifactStorageRecord.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/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.OrgsUpdate.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody`. + public var headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Billing email address. This address is not publicized. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/billing_email`. - public var billingEmail: Swift.String? - /// The company name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/company`. - public var company: Swift.String? - /// The publicly visible email address. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/email`. - public var email: Swift.String? - /// The Twitter username of the company. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/twitter_username`. - public var twitterUsername: Swift.String? - /// The location. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/location`. - public var location: Swift.String? - /// The shorthand name of the company. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// The description of the company. The maximum size is 160 characters. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/description`. - public var description: Swift.String? - /// Whether an organization can use organization projects. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_organization_projects`. - public var hasOrganizationProjects: Swift.Bool? - /// Whether repositories that belong to the organization can use repository projects. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_repository_projects`. - public var hasRepositoryProjects: Swift.Bool? - /// Default permission level members have for organization repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. - @frozen public enum DefaultRepositoryPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" - } - /// Default permission level members have for organization repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. - public var defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? - /// Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_repositories`. - public var membersCanCreateRepositories: Swift.Bool? - /// Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_internal_repositories`. - public var membersCanCreateInternalRepositories: Swift.Bool? - /// Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_repositories`. - public var membersCanCreatePrivateRepositories: Swift.Bool? - /// Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_repositories`. - public var membersCanCreatePublicRepositories: Swift.Bool? - /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. - @frozen public enum MembersAllowedRepositoryCreationTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case none = "none" - } - /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. - public var membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? - /// Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_pages`. - public var membersCanCreatePages: Swift.Bool? - /// Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_pages`. - public var membersCanCreatePublicPages: Swift.Bool? - /// Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_pages`. - public var membersCanCreatePrivatePages: Swift.Bool? - /// Whether organization members can fork private organization repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_fork_private_repositories`. - public var membersCanForkPrivateRepositories: Swift.Bool? - /// Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/web_commit_signoff_required`. - public var webCommitSignoffRequired: Swift.Bool? - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/blog`. - public var blog: Swift.String? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/advanced_security_enabled_for_new_repositories`. - @available(*, deprecated) - public var advancedSecurityEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_alerts_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependabotAlertsEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_security_updates_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependency_graph_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependencyGraphEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. + /// The name of the artifact. /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/name`. + public var name: Swift.String + /// The digest of the artifact (algorithm:hex-encoded-digest). /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/digest`. + public var digest: Swift.String + /// The artifact version. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_enabled_for_new_repositories`. - @available(*, deprecated) - public var secretScanningEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/version`. + public var version: Swift.String? + /// The URL where the artifact is stored. /// - /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/artifact_url`. + public var artifactUrl: Swift.String? + /// The path of the artifact. /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/path`. + public var path: Swift.String? + /// The base URL of the artifact registry. /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/registry_url`. + public var registryUrl: Swift.String + /// The repository name within the registry. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_enabled_for_new_repositories`. - @available(*, deprecated) - public var secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? - /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/repository`. + public var repository: Swift.String? + /// The status of the artifact (e.g., active, inactive). /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link_enabled`. - public var secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? - /// If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case eol = "eol" + case deleted = "deleted" + } + /// The status of the artifact (e.g., active, inactive). /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link`. - public var secretScanningPushProtectionCustomLink: Swift.String? - /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + public var status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? + /// The name of the GitHub repository associated with the artifact. This should be used + /// when there are no provenance attestations available for the artifact. The repository + /// must belong to the organization specified in the path parameter. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/deploy_keys_enabled_for_repositories`. - public var deployKeysEnabledForRepositories: Swift.Bool? + /// If a provenance attestation is available for the artifact, the API will use + /// the repository information from the attestation instead of this parameter. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/github_repository`. + public var githubRepository: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - billingEmail: Billing email address. This address is not publicized. - /// - company: The company name. - /// - email: The publicly visible email address. - /// - twitterUsername: The Twitter username of the company. - /// - location: The location. - /// - name: The shorthand name of the company. - /// - description: The description of the company. The maximum size is 160 characters. - /// - hasOrganizationProjects: Whether an organization can use organization projects. - /// - hasRepositoryProjects: Whether repositories that belong to the organization can use repository projects. - /// - defaultRepositoryPermission: Default permission level members have for organization repositories. - /// - membersCanCreateRepositories: Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. - /// - membersCanCreateInternalRepositories: Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersCanCreatePrivateRepositories: Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersCanCreatePublicRepositories: Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersAllowedRepositoryCreationType: Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// - membersCanCreatePages: Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanCreatePublicPages: Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanCreatePrivatePages: Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanForkPrivateRepositories: Whether organization members can fork private organization repositories. - /// - webCommitSignoffRequired: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. - /// - blog: - /// - advancedSecurityEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabotAlertsEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabotSecurityUpdatesEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependencyGraphEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningPushProtectionEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningPushProtectionCustomLinkEnabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. - /// - secretScanningPushProtectionCustomLink: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. - /// - deployKeysEnabledForRepositories: Controls whether or not deploy keys may be added and used for repositories in the organization. + /// - name: The name of the artifact. + /// - digest: The digest of the artifact (algorithm:hex-encoded-digest). + /// - version: The artifact version. + /// - artifactUrl: The URL where the artifact is stored. + /// - path: The path of the artifact. + /// - registryUrl: The base URL of the artifact registry. + /// - repository: The repository name within the registry. + /// - status: The status of the artifact (e.g., active, inactive). + /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used public init( - billingEmail: Swift.String? = nil, - company: Swift.String? = nil, - email: Swift.String? = nil, - twitterUsername: Swift.String? = nil, - location: Swift.String? = nil, - name: Swift.String? = nil, - description: Swift.String? = nil, - hasOrganizationProjects: Swift.Bool? = nil, - hasRepositoryProjects: Swift.Bool? = nil, - defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? = nil, - membersCanCreateRepositories: Swift.Bool? = nil, - membersCanCreateInternalRepositories: Swift.Bool? = nil, - membersCanCreatePrivateRepositories: Swift.Bool? = nil, - membersCanCreatePublicRepositories: Swift.Bool? = nil, - membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? = nil, - membersCanCreatePages: Swift.Bool? = nil, - membersCanCreatePublicPages: Swift.Bool? = nil, - membersCanCreatePrivatePages: Swift.Bool? = nil, - membersCanForkPrivateRepositories: Swift.Bool? = nil, - webCommitSignoffRequired: Swift.Bool? = nil, - blog: Swift.String? = nil, - advancedSecurityEnabledForNewRepositories: Swift.Bool? = nil, - dependabotAlertsEnabledForNewRepositories: Swift.Bool? = nil, - dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? = nil, - dependencyGraphEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? = nil, - secretScanningPushProtectionCustomLink: Swift.String? = nil, - deployKeysEnabledForRepositories: Swift.Bool? = nil + name: Swift.String, + digest: Swift.String, + version: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + path: Swift.String? = nil, + registryUrl: Swift.String, + repository: Swift.String? = nil, + status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? = nil, + githubRepository: Swift.String? = nil ) { - self.billingEmail = billingEmail - self.company = company - self.email = email - self.twitterUsername = twitterUsername - self.location = location self.name = name - self.description = description - self.hasOrganizationProjects = hasOrganizationProjects - self.hasRepositoryProjects = hasRepositoryProjects - self.defaultRepositoryPermission = defaultRepositoryPermission - self.membersCanCreateRepositories = membersCanCreateRepositories - self.membersCanCreateInternalRepositories = membersCanCreateInternalRepositories - self.membersCanCreatePrivateRepositories = membersCanCreatePrivateRepositories - self.membersCanCreatePublicRepositories = membersCanCreatePublicRepositories - self.membersAllowedRepositoryCreationType = membersAllowedRepositoryCreationType - self.membersCanCreatePages = membersCanCreatePages - self.membersCanCreatePublicPages = membersCanCreatePublicPages - self.membersCanCreatePrivatePages = membersCanCreatePrivatePages - self.membersCanForkPrivateRepositories = membersCanForkPrivateRepositories - self.webCommitSignoffRequired = webCommitSignoffRequired - self.blog = blog - self.advancedSecurityEnabledForNewRepositories = advancedSecurityEnabledForNewRepositories - self.dependabotAlertsEnabledForNewRepositories = dependabotAlertsEnabledForNewRepositories - self.dependabotSecurityUpdatesEnabledForNewRepositories = dependabotSecurityUpdatesEnabledForNewRepositories - self.dependencyGraphEnabledForNewRepositories = dependencyGraphEnabledForNewRepositories - self.secretScanningEnabledForNewRepositories = secretScanningEnabledForNewRepositories - self.secretScanningPushProtectionEnabledForNewRepositories = secretScanningPushProtectionEnabledForNewRepositories - self.secretScanningPushProtectionCustomLinkEnabled = secretScanningPushProtectionCustomLinkEnabled - self.secretScanningPushProtectionCustomLink = secretScanningPushProtectionCustomLink - self.deployKeysEnabledForRepositories = deployKeysEnabledForRepositories + self.digest = digest + self.version = version + self.artifactUrl = artifactUrl + self.path = path + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.githubRepository = githubRepository } public enum CodingKeys: String, CodingKey { - case billingEmail = "billing_email" - case company - case email - case twitterUsername = "twitter_username" - case location case name - case description - case hasOrganizationProjects = "has_organization_projects" - case hasRepositoryProjects = "has_repository_projects" - case defaultRepositoryPermission = "default_repository_permission" - case membersCanCreateRepositories = "members_can_create_repositories" - case membersCanCreateInternalRepositories = "members_can_create_internal_repositories" - case membersCanCreatePrivateRepositories = "members_can_create_private_repositories" - case membersCanCreatePublicRepositories = "members_can_create_public_repositories" - case membersAllowedRepositoryCreationType = "members_allowed_repository_creation_type" - case membersCanCreatePages = "members_can_create_pages" - case membersCanCreatePublicPages = "members_can_create_public_pages" - case membersCanCreatePrivatePages = "members_can_create_private_pages" - case membersCanForkPrivateRepositories = "members_can_fork_private_repositories" - case webCommitSignoffRequired = "web_commit_signoff_required" - case blog - case advancedSecurityEnabledForNewRepositories = "advanced_security_enabled_for_new_repositories" - case dependabotAlertsEnabledForNewRepositories = "dependabot_alerts_enabled_for_new_repositories" - case dependabotSecurityUpdatesEnabledForNewRepositories = "dependabot_security_updates_enabled_for_new_repositories" - case dependencyGraphEnabledForNewRepositories = "dependency_graph_enabled_for_new_repositories" - case secretScanningEnabledForNewRepositories = "secret_scanning_enabled_for_new_repositories" - case secretScanningPushProtectionEnabledForNewRepositories = "secret_scanning_push_protection_enabled_for_new_repositories" - case secretScanningPushProtectionCustomLinkEnabled = "secret_scanning_push_protection_custom_link_enabled" - case secretScanningPushProtectionCustomLink = "secret_scanning_push_protection_custom_link" - case deployKeysEnabledForRepositories = "deploy_keys_enabled_for_repositories" + case digest + case version + case artifactUrl = "artifact_url" + case path + case registryUrl = "registry_url" + case repository + case status + case githubRepository = "github_repository" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, + headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactStorageRecord.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}/artifacts/metadata/storage-record/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } } - } - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdate.Input.Body.JsonPayload) - } - public var body: Operations.OrgsUpdate.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.OrgsUpdate.Input.Path, - headers: Operations.OrgsUpdate.Input.Headers = .init(), - body: Operations.OrgsUpdate.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationFull) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.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.OrganizationFull { + public var json: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -10612,26 +12377,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdate.Output.Ok.Body + public var body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdate.Output.Ok.Body) { + public init(body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body) { self.body = body } } - /// Response + /// Artifact metadata storage record stored successfully. /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdate.Output.Ok) + case ok(Operations.OrgsCreateArtifactStorageRecord.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.OrgsUpdate.Output.Ok { + public var ok: Operations.OrgsCreateArtifactStorageRecord.Output.Ok { get throws { switch self { case let .ok(response): @@ -10644,51 +12409,131 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content`. + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List artifact deployment records + /// + /// List deployment records for an artifact metadata associated with an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/get(orgs/list-artifact-deployment-records)`. + public enum OrgsListArtifactDeploymentRecords { + public static let id: Swift.String = "orgs/list-artifact-deployment-records" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/path/org`. + public var org: Components.Parameters.Org + /// The SHA256 digest of the artifact, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/path/subject_digest`. + public var subjectDigest: Components.Parameters.SubjectDigest + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: The SHA256 digest of the artifact, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Components.Parameters.SubjectDigest + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsListArtifactDeploymentRecords.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListArtifactDeploymentRecords.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsListArtifactDeploymentRecords.Input.Path, + headers: Operations.OrgsListArtifactDeploymentRecords.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}/artifacts/{subject_digest}/metadata/deployment-records/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case1`. - case ValidationError(Components.Schemas.ValidationError) - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case2`. - case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .ValidationError(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .ValidationErrorSimple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of deployment records for this digest and organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/responses/200/content/json/deployment_records`. + public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of deployment records for this digest and organization + /// - deploymentRecords: + public init( + totalCount: Swift.Int? = nil, + deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil + ) { + self.totalCount = totalCount + self.deploymentRecords = deploymentRecords } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .ValidationError(value): - try value.encode(to: encoder) - case let .ValidationErrorSimple(value): - try value.encode(to: encoder) - } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case deploymentRecords = "deployment_records" } } - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/application\/json`. - case json(Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListArtifactDeploymentRecords.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.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload { + public var json: Operations.OrgsListArtifactDeploymentRecords.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -10698,56 +12543,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdate.Output.UnprocessableContent.Body - /// Creates a new `UnprocessableContent`. + public var body: Operations.OrgsListArtifactDeploymentRecords.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdate.Output.UnprocessableContent.Body) { + public init(body: Operations.OrgsListArtifactDeploymentRecords.Output.Ok.Body) { self.body = body } } - /// Validation failed - /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsUpdate.Output.UnprocessableContent) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsUpdate.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Conflict + /// Successful response /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records/get(orgs/list-artifact-deployment-records)/responses/200`. /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListArtifactDeploymentRecords.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListArtifactDeploymentRecords.Output.Ok { get throws { switch self { - case let .conflict(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "ok", response: self ) } @@ -10784,126 +12606,205 @@ public enum Operations { } } } - /// Delete an organization - /// - /// Deletes an organization and all its repositories. - /// - /// The organization login will be unavailable for 90 days after deletion. - /// - /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// List artifact storage records /// - /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. - public enum OrgsDelete { - public static let id: Swift.String = "orgs/delete" + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public enum OrgsListArtifactStorageRecords { + public static let id: Swift.String = "orgs/list-artifact-storage-records" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/org`. public var org: Components.Parameters.Org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/subject_digest`. + public var subjectDigest: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { self.org = org + self.subjectDigest = subjectDigest } } - public var path: Operations.OrgsDelete.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/header`. + public var path: Operations.OrgsListArtifactStorageRecords.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/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.OrgsDelete.Input.Headers + public var headers: Operations.OrgsListArtifactStorageRecords.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsDelete.Input.Path, - headers: Operations.OrgsDelete.Input.Headers = .init() + path: Operations.OrgsListArtifactStorageRecords.Input.Path, + headers: Operations.OrgsListArtifactStorageRecords.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Accepted - /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/202`. - /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. - /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { - get throws { - switch self { - case let .accepted(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "accepted", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of storage records for this digest and organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of storage records for this digest and organization + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListArtifactStorageRecords.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.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body) { + self.body = body + } } - /// Forbidden + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)/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.OrgsListArtifactStorageRecords.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.OrgsListArtifactStorageRecords.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 ) } @@ -10940,242 +12841,334 @@ public enum Operations { } } } - /// Create artifact metadata storage record + /// List attestations by bulk subject digests /// - /// Create metadata storage records for artifacts associated with an organization. - /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and - /// associated with a repository owned by the organization. + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. /// - /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. - public enum OrgsCreateArtifactStorageRecord { - public static let id: Swift.String = "orgs/create-artifact-storage-record" + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. + public enum OrgsListAttestationsBulk { + public static let id: Swift.String = "orgs/list-attestations-bulk" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/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}/attestations/bulk-list/POST/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after } } - public var path: Operations.OrgsCreateArtifactStorageRecord.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/header`. + public var query: Operations.OrgsListAttestationsBulk.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/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.OrgsCreateArtifactStorageRecord.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody`. + public var headers: Operations.OrgsListAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the artifact. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/name`. - public var name: Swift.String - /// The digest of the artifact (algorithm:hex-encoded-digest). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/digest`. - public var digest: Swift.String - /// The URL where the artifact is stored. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/artifact_url`. - public var artifactUrl: Swift.String? - /// The path of the artifact. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/path`. - public var path: Swift.String? - /// The base URL of the artifact registry. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/registry_url`. - public var registryUrl: Swift.String - /// The repository name within the registry. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/repository`. - public var repository: Swift.String? - /// The status of the artifact (e.g., active, inactive). + /// List of subject digests to fetch attestations for. /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case active = "active" - case eol = "eol" - case deleted = "deleted" - } - /// The status of the artifact (e.g., active, inactive). + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/subject_digests`. + public var subjectDigests: [Swift.String] + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. - public var status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/predicate_type`. + public var predicateType: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: The name of the artifact. - /// - digest: The digest of the artifact (algorithm:hex-encoded-digest). - /// - artifactUrl: The URL where the artifact is stored. - /// - path: The path of the artifact. - /// - registryUrl: The base URL of the artifact registry. - /// - repository: The repository name within the registry. - /// - status: The status of the artifact (e.g., active, inactive). + /// - subjectDigests: List of subject digests to fetch attestations for. + /// - predicateType: Optional filter for fetching attestations with a given predicate type. public init( - name: Swift.String, - digest: Swift.String, - artifactUrl: Swift.String? = nil, - path: Swift.String? = nil, - registryUrl: Swift.String, - repository: Swift.String? = nil, - status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? = nil + subjectDigests: [Swift.String], + predicateType: Swift.String? = nil ) { - self.name = name - self.digest = digest - self.artifactUrl = artifactUrl - self.path = path - self.registryUrl = registryUrl - self.repository = repository - self.status = status + self.subjectDigests = subjectDigests + self.predicateType = predicateType } public enum CodingKeys: String, CodingKey { - case name - case digest - case artifactUrl = "artifact_url" - case path - case registryUrl = "registry_url" - case repository - case status + case subjectDigests = "subject_digests" + case predicateType = "predicate_type" } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/content/application\/json`. - case json(Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/content/application\/json`. + case json(Operations.OrgsListAttestationsBulk.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + public var body: Operations.OrgsListAttestationsBulk.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: /// - body: public init( - path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, - headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), - body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + path: Operations.OrgsListAttestationsBulk.Input.Path, + query: Operations.OrgsListAttestationsBulk.Input.Query = .init(), + headers: Operations.OrgsListAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsListAttestationsBulk.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}/artifacts/metadata/storage-record/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/total_count`. - public var totalCount: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload`. - public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/digest`. - public var digest: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/artifact_url`. - public var artifactUrl: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/registry_url`. - public var registryUrl: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/repository`. - public var repository: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/status`. - public var status: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/created_at`. - public var createdAt: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/updated_at`. - public var updatedAt: Swift.String? - /// Creates a new `StorageRecordsPayloadPayload`. + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public struct AttestationsSubjectDigestsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public var bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The bundle of the attestation. + /// - repositoryId: + /// - bundleUrl: + public init( + bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] + /// Creates a new `AttestationsSubjectDigestsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public var attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public struct PageInfoPayload: Codable, Hashable, Sendable { + /// Indicates whether there is a next page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_next`. + public var hasNext: Swift.Bool? + /// Indicates whether there is a previous page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_previous`. + public var hasPrevious: Swift.Bool? + /// The cursor to the next page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/next`. + public var next: Swift.String? + /// The cursor to the previous page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/previous`. + public var previous: Swift.String? + /// Creates a new `PageInfoPayload`. /// /// - Parameters: - /// - id: - /// - name: - /// - digest: - /// - artifactUrl: - /// - registryUrl: - /// - repository: - /// - status: - /// - createdAt: - /// - updatedAt: + /// - hasNext: Indicates whether there is a next page. + /// - hasPrevious: Indicates whether there is a previous page. + /// - next: The cursor to the next page. + /// - previous: The cursor to the previous page. public init( - id: Swift.Int? = nil, - name: Swift.String? = nil, - digest: Swift.String? = nil, - artifactUrl: Swift.String? = nil, - registryUrl: Swift.String? = nil, - repository: Swift.String? = nil, - status: Swift.String? = nil, - createdAt: Swift.String? = nil, - updatedAt: Swift.String? = nil + hasNext: Swift.Bool? = nil, + hasPrevious: Swift.Bool? = nil, + next: Swift.String? = nil, + previous: Swift.String? = nil ) { - self.id = id - self.name = name - self.digest = digest - self.artifactUrl = artifactUrl - self.registryUrl = registryUrl - self.repository = repository - self.status = status - self.createdAt = createdAt - self.updatedAt = updatedAt + self.hasNext = hasNext + self.hasPrevious = hasPrevious + self.next = next + self.previous = previous } public enum CodingKeys: String, CodingKey { - case id - case name - case digest - case artifactUrl = "artifact_url" - case registryUrl = "registry_url" - case repository - case status - case createdAt = "created_at" - case updatedAt = "updated_at" + case hasNext = "has_next" + case hasPrevious = "has_previous" + case next + case previous } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. - public typealias StorageRecordsPayload = [Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. - public var storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public var pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - totalCount: - /// - storageRecords: + /// - attestationsSubjectDigests: Mapping of subject digest to bundles. + /// - pageInfo: Information about the current page. public init( - totalCount: Swift.Int? = nil, - storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? = nil, + pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? = nil ) { - self.totalCount = totalCount - self.storageRecords = storageRecords + self.attestationsSubjectDigests = attestationsSubjectDigests + self.pageInfo = pageInfo } public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case storageRecords = "storage_records" + case attestationsSubjectDigests = "attestations_subject_digests" + case pageInfo = "page_info" } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/application\/json`. - case json(Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestationsBulk.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.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload { + public var json: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -11185,26 +13178,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + public var body: Operations.OrgsListAttestationsBulk.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body) { + public init(body: Operations.OrgsListAttestationsBulk.Output.Ok.Body) { self.body = body } } - /// Artifact metadata storage record stored successfully. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateArtifactStorageRecord.Output.Ok) + case ok(Operations.OrgsListAttestationsBulk.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.OrgsCreateArtifactStorageRecord.Output.Ok { + public var ok: Operations.OrgsListAttestationsBulk.Output.Ok { get throws { switch self { case let .ok(response): @@ -11248,198 +13241,159 @@ public enum Operations { } } } - /// List artifact storage records - /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// Delete attestations in bulk /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Delete artifact attestations in bulk by either subject digests or unique ID. /// - /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. - public enum OrgsListArtifactStorageRecords { - public static let id: Swift.String = "orgs/list-artifact-storage-records" + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public enum OrgsDeleteAttestationsBulk { + public static let id: Swift.String = "orgs/delete-attestations-bulk" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path/org`. public var org: Components.Parameters.Org - /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/subject_digest`. - public var subjectDigest: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. - public init( - org: Components.Parameters.Org, - subjectDigest: Swift.String - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.subjectDigest = subjectDigest } } - public var path: Operations.OrgsListArtifactStorageRecords.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/header`. + public var path: Operations.OrgsDeleteAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/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.OrgsListArtifactStorageRecords.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.OrgsListArtifactStorageRecords.Input.Path, - headers: Operations.OrgsListArtifactStorageRecords.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}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The number of storage records for this digest and organization - /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload`. - public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/digest`. - public var digest: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/artifact_url`. - public var artifactUrl: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/registry_url`. - public var registryUrl: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/repository`. - public var repository: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/status`. - public var status: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/created_at`. - public var createdAt: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/updated_at`. - public var updatedAt: Swift.String? - /// Creates a new `StorageRecordsPayloadPayload`. - /// - /// - Parameters: - /// - id: - /// - name: - /// - digest: - /// - artifactUrl: - /// - registryUrl: - /// - repository: - /// - status: - /// - createdAt: - /// - updatedAt: - public init( - id: Swift.Int? = nil, - name: Swift.String? = nil, - digest: Swift.String? = nil, - artifactUrl: Swift.String? = nil, - registryUrl: Swift.String? = nil, - repository: Swift.String? = nil, - status: Swift.String? = nil, - createdAt: Swift.String? = nil, - updatedAt: Swift.String? = nil - ) { - self.id = id - self.name = name - self.digest = digest - self.artifactUrl = artifactUrl - self.registryUrl = registryUrl - self.repository = repository - self.status = status - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case id - case name - case digest - case artifactUrl = "artifact_url" - case registryUrl = "registry_url" - case repository - case status - case createdAt = "created_at" - case updatedAt = "updated_at" - } + public var headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// The request body must include either `subject_digests` or `attestation_ids`, but not both. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// List of subject digests associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1/subject_digests`. + public var subjectDigests: [Swift.String] + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests associated with the artifact attestations to delete. + public init(subjectDigests: [Swift.String]) { + self.subjectDigests = subjectDigests } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. - public typealias StorageRecordsPayload = [Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. - public var storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? - /// Creates a new `JsonPayload`. + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + case case1(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// List of unique IDs associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2/attestation_ids`. + public var attestationIds: [Swift.Int] + /// Creates a new `Case2Payload`. /// /// - Parameters: - /// - totalCount: The number of storage records for this digest and organization - /// - storageRecords: - public init( - totalCount: Swift.Int? = nil, - storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil - ) { - self.totalCount = totalCount - self.storageRecords = storageRecords + /// - attestationIds: List of unique IDs associated with the artifact attestations to delete. + public init(attestationIds: [Swift.Int]) { + self.attestationIds = attestationIds } public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case storageRecords = "storage_records" + case attestationIds = "attestation_ids" } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListArtifactStorageRecords.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.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + case case2(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) } } } - /// Received HTTP response body - public var body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/content/application\/json`. + case json(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.OrgsDeleteAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsDeleteAttestationsBulk.Input.Path, + headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsDeleteAttestationsBulk.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body) { - self.body = body - } + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListArtifactStorageRecords.Output.Ok) + case ok(Operations.OrgsDeleteAttestationsBulk.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } /// 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.OrgsListArtifactStorageRecords.Output.Ok { + public var ok: Operations.OrgsDeleteAttestationsBulk.Output.Ok { get throws { switch self { case let .ok(response): @@ -11452,6 +13406,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/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. @@ -11483,370 +13460,153 @@ public enum Operations { } } } - /// List attestations by bulk subject digests - /// - /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. - /// - /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// Delete attestations by subject digest /// - /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Delete an artifact attestation by subject digest. /// - /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. - public enum OrgsListAttestationsBulk { - public static let id: Swift.String = "orgs/list-attestations-bulk" + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public enum OrgsDeleteAttestationsBySubjectDigest { + public static let id: Swift.String = "orgs/delete-attestations-by-subject-digest" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/org`. public var org: Components.Parameters.Org + /// Subject Digest + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/subject_digest`. + public var subjectDigest: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListAttestationsBulk.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/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}/attestations/bulk-list/POST/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - subjectDigest: Subject Digest public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil + org: Components.Parameters.Org, + subjectDigest: Swift.String ) { - self.perPage = perPage - self.before = before - self.after = after + self.org = org + self.subjectDigest = subjectDigest } } - public var query: Operations.OrgsListAttestationsBulk.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/header`. + public var path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/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.OrgsListAttestationsBulk.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of subject digests to fetch attestations for. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/subject_digests`. - public var subjectDigests: [Swift.String] - /// Optional filter for fetching attestations with a given predicate type. - /// This option accepts `provenance`, `sbom`, `release`, or freeform text - /// for custom predicate types. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/predicate_type`. - public var predicateType: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subjectDigests: List of subject digests to fetch attestations for. - /// - predicateType: Optional filter for fetching attestations with a given predicate type. - public init( - subjectDigests: [Swift.String], - predicateType: Swift.String? = nil - ) { - self.subjectDigests = subjectDigests - self.predicateType = predicateType - } - public enum CodingKeys: String, CodingKey { - case subjectDigests = "subject_digests" - case predicateType = "predicate_type" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/content/application\/json`. - case json(Operations.OrgsListAttestationsBulk.Input.Body.JsonPayload) - } - public var body: Operations.OrgsListAttestationsBulk.Input.Body + public var headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: - /// - body: public init( - path: Operations.OrgsListAttestationsBulk.Input.Path, - query: Operations.OrgsListAttestationsBulk.Input.Query = .init(), - headers: Operations.OrgsListAttestationsBulk.Input.Headers = .init(), - body: Operations.OrgsListAttestationsBulk.Input.Body + path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() ) { 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}/attestations/bulk-list/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Mapping of subject digest to bundles. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. - public struct AttestationsSubjectDigestsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload`. - public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { - /// The bundle of the attestation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. - public struct BundlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/mediaType`. - public var mediaType: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. - public struct VerificationMaterialPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `VerificationMaterialPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. - public var verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. - public struct DsseEnvelopePayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `DsseEnvelopePayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. - public var dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? - /// Creates a new `BundlePayload`. - /// - /// - Parameters: - /// - mediaType: - /// - verificationMaterial: - /// - dsseEnvelope: - public init( - mediaType: Swift.String? = nil, - verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, - dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil - ) { - self.mediaType = mediaType - self.verificationMaterial = verificationMaterial - self.dsseEnvelope = dsseEnvelope - } - public enum CodingKeys: String, CodingKey { - case mediaType - case verificationMaterial - case dsseEnvelope - } - } - /// The bundle of the attestation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. - public var bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/repository_id`. - public var repositoryId: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle_url`. - public var bundleUrl: Swift.String? - /// Creates a new `AdditionalPropertiesPayloadPayload`. - /// - /// - Parameters: - /// - bundle: The bundle of the attestation. - /// - repositoryId: - /// - bundleUrl: - public init( - bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? = nil, - repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil - ) { - self.bundle = bundle - self.repositoryId = repositoryId - self.bundleUrl = bundleUrl - } - public enum CodingKeys: String, CodingKey { - case bundle - case repositoryId = "repository_id" - case bundleUrl = "bundle_url" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/additionalProperties`. - public typealias AdditionalPropertiesPayload = [Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload] - /// A container of undocumented properties. - public var additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] - /// Creates a new `AttestationsSubjectDigestsPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// Mapping of subject digest to bundles. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. - public var attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? - /// Information about the current page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. - public struct PageInfoPayload: Codable, Hashable, Sendable { - /// Indicates whether there is a next page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_next`. - public var hasNext: Swift.Bool? - /// Indicates whether there is a previous page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_previous`. - public var hasPrevious: Swift.Bool? - /// The cursor to the next page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/next`. - public var next: Swift.String? - /// The cursor to the previous page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/previous`. - public var previous: Swift.String? - /// Creates a new `PageInfoPayload`. - /// - /// - Parameters: - /// - hasNext: Indicates whether there is a next page. - /// - hasPrevious: Indicates whether there is a previous page. - /// - next: The cursor to the next page. - /// - previous: The cursor to the previous page. - public init( - hasNext: Swift.Bool? = nil, - hasPrevious: Swift.Bool? = nil, - next: Swift.String? = nil, - previous: Swift.String? = nil - ) { - self.hasNext = hasNext - self.hasPrevious = hasPrevious - self.next = next - self.previous = previous - } - public enum CodingKeys: String, CodingKey { - case hasNext = "has_next" - case hasPrevious = "has_previous" - case next - case previous - } - } - /// Information about the current page. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. - public var pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - attestationsSubjectDigests: Mapping of subject digest to bundles. - /// - pageInfo: Information about the current page. - public init( - attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? = nil, - pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? = nil - ) { - self.attestationsSubjectDigests = attestationsSubjectDigests - self.pageInfo = pageInfo - } - public enum CodingKeys: String, CodingKey { - case attestationsSubjectDigests = "attestations_subject_digests" - case pageInfo = "page_info" - } + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// 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.OrgsDeleteAttestationsBySubjectDigest.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/application\/json`. - case json(Operations.OrgsListAttestationsBulk.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.OrgsListAttestationsBulk.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}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/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.OrgsDeleteAttestationsBySubjectDigest.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.OrgsListAttestationsBulk.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsListAttestationsBulk.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAttestationsBulk.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListAttestationsBulk.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -11883,20 +13643,21 @@ public enum Operations { } } } - /// Delete attestations in bulk + /// List attestation repositories /// - /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// List repositories owned by the provided organization that have created at least one attested artifact + /// Results will be sorted in ascending order by repository ID /// - /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. - public enum OrgsDeleteAttestationsBulk { - public static let id: Swift.String = "orgs/delete-attestations-bulk" + /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. + public enum OrgsListAttestationRepositories { + public static let id: Swift.String = "orgs/list-attestation-repositories" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11906,136 +13667,140 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsDeleteAttestationsBulk.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/header`. + public var path: Operations.OrgsListAttestationRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/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}/attestations/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/predicate_type`. + public var predicateType: Swift.String? + /// 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)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + predicateType: Swift.String? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + self.predicateType = predicateType + } + } + public var query: Operations.OrgsListAttestationRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/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.OrgsDeleteAttestationsBulk.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// The request body must include either `subject_digests` or `attestation_ids`, but not both. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// List of subject digests associated with the artifact attestations to delete. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1/subject_digests`. - public var subjectDigests: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - subjectDigests: List of subject digests associated with the artifact attestations to delete. - public init(subjectDigests: [Swift.String]) { - self.subjectDigests = subjectDigests - } - public enum CodingKeys: String, CodingKey { - case subjectDigests = "subject_digests" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. - case case1(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// List of unique IDs associated with the artifact attestations to delete. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2/attestation_ids`. - public var attestationIds: [Swift.Int] - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - attestationIds: List of unique IDs associated with the artifact attestations to delete. - public init(attestationIds: [Swift.Int]) { - self.attestationIds = attestationIds - } - public enum CodingKeys: String, CodingKey { - case attestationIds = "attestation_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. - case case2(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/content/application\/json`. - case json(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload) - } - public var body: Operations.OrgsDeleteAttestationsBulk.Input.Body + public var headers: Operations.OrgsListAttestationRepositories.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.OrgsDeleteAttestationsBulk.Input.Path, - headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), - body: Operations.OrgsDeleteAttestationsBulk.Input.Body + path: Operations.OrgsListAttestationRepositories.Input.Path, + query: Operations.OrgsListAttestationRepositories.Input.Query = .init(), + headers: Operations.OrgsListAttestationRepositories.Input.Headers = .init() ) { 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}/attestations/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload`. + public struct JsonPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/name`. + public var name: Swift.String? + /// Creates a new `JsonPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil + ) { + self.id = id + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case name + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/json`. + public typealias JsonPayload = [Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestationRepositories.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.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListAttestationRepositories.Output.Ok.Body /// Creates a new `Ok`. - public init() {} + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListAttestationRepositories.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsDeleteAttestationsBulk.Output.Ok) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)/responses/200`. /// /// HTTP response code: `200 ok`. - public static var ok: Self { - .ok(.init()) - } + case ok(Operations.OrgsListAttestationRepositories.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.OrgsDeleteAttestationsBulk.Output.Ok { + public var ok: Operations.OrgsListAttestationRepositories.Output.Ok { get throws { switch self { case let .ok(response): @@ -12048,29 +13813,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/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. @@ -12102,59 +13844,59 @@ public enum Operations { } } } - /// Delete attestations by subject digest + /// Delete attestations by ID /// - /// Delete an artifact attestation by subject digest. + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. /// - /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. - public enum OrgsDeleteAttestationsBySubjectDigest { - public static let id: Swift.String = "orgs/delete-attestations-by-subject-digest" + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public enum OrgsDeleteAttestationsById { + public static let id: Swift.String = "orgs/delete-attestations-by-id" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Subject Digest + /// Attestation ID /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/subject_digest`. - public var subjectDigest: Swift.String + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/attestation_id`. + public var attestationId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - subjectDigest: Subject Digest + /// - attestationId: Attestation ID public init( org: Components.Parameters.Org, - subjectDigest: Swift.String + attestationId: Swift.Int ) { self.org = org - self.subjectDigest = subjectDigest + self.attestationId = attestationId } } - public var path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/header`. + public var path: Operations.OrgsDeleteAttestationsById.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_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.OrgsDeleteAttestationsBySubjectDigest.Input.Headers + public var headers: Operations.OrgsDeleteAttestationsById.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, - headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() + path: Operations.OrgsDeleteAttestationsById.Input.Path, + headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12167,13 +13909,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok) + case ok(Operations.OrgsDeleteAttestationsById.Output.Ok) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. /// /// HTTP response code: `200 ok`. public static var ok: Self { @@ -12183,7 +13925,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok { + public var ok: Operations.OrgsDeleteAttestationsById.Output.Ok { get throws { switch self { case let .ok(response): @@ -12202,13 +13944,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent) + case noContent(Operations.OrgsDeleteAttestationsById.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -12218,7 +13960,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent { + public var noContent: Operations.OrgsDeleteAttestationsById.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -12231,9 +13973,32 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/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}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -12285,50 +14050,62 @@ public enum Operations { } } } - /// List attestation repositories + /// List attestations /// - /// List repositories owned by the provided organization that have created at least one attested artifact - /// Results will be sorted in ascending order by repository ID + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. - public enum OrgsListAttestationRepositories { - public static let id: Swift.String = "orgs/list-attestation-repositories" + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public enum OrgsListAttestations { + public static let id: Swift.String = "orgs/list-attestations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/org`. public var org: Components.Parameters.Org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/subject_digest`. + public var subjectDigest: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { self.org = org + self.subjectDigest = subjectDigest } } - public var path: Operations.OrgsListAttestationRepositories.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query`. + public var path: Operations.OrgsListAttestations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/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}/attestations/repositories/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/before`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/before`. public var before: Components.Parameters.PaginationBefore? /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/after`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.PaginationAfter? /// Optional filter for fetching attestations with a given predicate type. /// This option accepts `provenance`, `sbom`, `release`, or freeform text /// for custom predicate types. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/predicate_type`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/predicate_type`. public var predicateType: Swift.String? /// Creates a new `Query`. /// @@ -12349,19 +14126,19 @@ public enum Operations { self.predicateType = predicateType } } - public var query: Operations.OrgsListAttestationRepositories.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/header`. + public var query: Operations.OrgsListAttestations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/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.OrgsListAttestationRepositories.Input.Headers + public var headers: Operations.OrgsListAttestations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -12369,9 +14146,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListAttestationRepositories.Input.Path, - query: Operations.OrgsListAttestationRepositories.Input.Query = .init(), - headers: Operations.OrgsListAttestationRepositories.Input.Headers = .init() + path: Operations.OrgsListAttestations.Input.Path, + query: Operations.OrgsListAttestations.Input.Query = .init(), + headers: Operations.OrgsListAttestations.Input.Headers = .init() ) { self.path = path self.query = query @@ -12380,40 +14157,138 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload`. - public struct JsonPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/name`. - public var name: Swift.String? - /// Creates a new `JsonPayloadPayload`. + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload`. + public struct AttestationsPayloadPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. + public var bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? + /// Creates a new `AttestationsPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The attestation's Sigstore Bundle. + /// - repositoryId: + /// - bundleUrl: + /// - initiator: + public init( + bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + self.initiator = initiator + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + case initiator + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public typealias AttestationsPayload = [Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public var attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? + /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - id: - /// - name: - public init( - id: Swift.Int? = nil, - name: Swift.String? = nil - ) { - self.id = id - self.name = name + /// - attestations: + public init(attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? = nil) { + self.attestations = attestations } public enum CodingKeys: String, CodingKey { - case id - case name + case attestations } } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/json`. - public typealias JsonPayload = [Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayloadPayload] - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestations.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.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload { + public var json: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12423,26 +14298,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListAttestationRepositories.Output.Ok.Body + public var body: Operations.OrgsListAttestations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsListAttestationRepositories.Output.Ok.Body) { + public init(body: Operations.OrgsListAttestations.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAttestationRepositories.Output.Ok) + case ok(Operations.OrgsListAttestations.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.OrgsListAttestationRepositories.Output.Ok { + public var ok: Operations.OrgsListAttestations.Output.Ok { get throws { switch self { case let .ok(response): @@ -12486,176 +14361,129 @@ public enum Operations { } } } - /// Delete attestations by ID + /// List users blocked by an organization /// - /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// List the users blocked by an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. - public enum OrgsDeleteAttestationsById { - public static let id: Swift.String = "orgs/delete-attestations-by-id" + /// - Remark: HTTP `GET /orgs/{org}/blocks`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. + public enum OrgsListBlockedUsers { + public static let id: Swift.String = "orgs/list-blocked-users" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path/org`. public var org: Components.Parameters.Org - /// Attestation ID - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/attestation_id`. - public var attestationId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - attestationId: Attestation ID + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListBlockedUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/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}/blocks/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}/blocks/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( - org: Components.Parameters.Org, - attestationId: Swift.Int + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.attestationId = attestationId + self.perPage = perPage + self.page = page } } - public var path: Operations.OrgsDeleteAttestationsById.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/header`. + public var query: Operations.OrgsListBlockedUsers.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/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.OrgsDeleteAttestationsById.Input.Headers + public var headers: Operations.OrgsListBlockedUsers.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsDeleteAttestationsById.Input.Path, - headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() + path: Operations.OrgsListBlockedUsers.Input.Path, + query: Operations.OrgsListBlockedUsers.Input.Query = .init(), + headers: Operations.OrgsListBlockedUsers.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}/blocks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListBlockedUsers.Output.Ok.Body /// Creates a new `Ok`. - public init() {} + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListBlockedUsers.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsDeleteAttestationsById.Output.Ok) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)/responses/200`. /// /// HTTP response code: `200 ok`. - public static var ok: Self { - .ok(.init()) - } + case ok(Operations.OrgsListBlockedUsers.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.OrgsDeleteAttestationsById.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsDeleteAttestationsById.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/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.OrgsDeleteAttestationsById.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}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/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}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/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 { + public var ok: Operations.OrgsListBlockedUsers.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -12692,245 +14520,110 @@ public enum Operations { } } } - /// List attestations - /// - /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. - /// - /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// Check if a user is blocked by an organization /// - /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. /// - /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. - public enum OrgsListAttestations { - public static let id: Swift.String = "orgs/list-attestations" + /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. + public enum OrgsCheckBlockedUser { + public static let id: Swift.String = "orgs/check-blocked-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/org`. public var org: Components.Parameters.Org - /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/subject_digest`. - public var subjectDigest: Swift.String + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - subjectDigest: Swift.String + username: Components.Parameters.Username ) { self.org = org - self.subjectDigest = subjectDigest - } - } - public var path: Operations.OrgsListAttestations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/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}/attestations/{subject_digest}/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// Optional filter for fetching attestations with a given predicate type. - /// This option accepts `provenance`, `sbom`, `release`, or freeform text - /// for custom predicate types. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/predicate_type`. - public var predicateType: Swift.String? - /// 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)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - predicateType: Optional filter for fetching attestations with a given predicate type. - public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - predicateType: Swift.String? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after - self.predicateType = predicateType + self.username = username } } - public var query: Operations.OrgsListAttestations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/header`. + public var path: Operations.OrgsCheckBlockedUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/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.OrgsListAttestations.Input.Headers + public var headers: Operations.OrgsCheckBlockedUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListAttestations.Input.Path, - query: Operations.OrgsListAttestations.Input.Query = .init(), - headers: Operations.OrgsListAttestations.Input.Headers = .init() + path: Operations.OrgsCheckBlockedUser.Input.Path, + headers: Operations.OrgsCheckBlockedUser.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}/attestations/{subject_digest}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload`. - public struct AttestationsPayloadPayload: Codable, Hashable, Sendable { - /// The attestation's Sigstore Bundle. - /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. - public struct BundlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/mediaType`. - public var mediaType: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. - public struct VerificationMaterialPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `VerificationMaterialPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. - public var verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. - public struct DsseEnvelopePayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `DsseEnvelopePayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. - public var dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? - /// Creates a new `BundlePayload`. - /// - /// - Parameters: - /// - mediaType: - /// - verificationMaterial: - /// - dsseEnvelope: - public init( - mediaType: Swift.String? = nil, - verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, - dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil - ) { - self.mediaType = mediaType - self.verificationMaterial = verificationMaterial - self.dsseEnvelope = dsseEnvelope - } - public enum CodingKeys: String, CodingKey { - case mediaType - case verificationMaterial - case dsseEnvelope - } - } - /// The attestation's Sigstore Bundle. - /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. - public var bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/repository_id`. - public var repositoryId: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. - public var bundleUrl: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. - public var initiator: Swift.String? - /// Creates a new `AttestationsPayloadPayload`. - /// - /// - Parameters: - /// - bundle: The attestation's Sigstore Bundle. - /// - repositoryId: - /// - bundleUrl: - /// - initiator: - public init( - bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, - repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil, - initiator: Swift.String? = nil - ) { - self.bundle = bundle - self.repositoryId = repositoryId - self.bundleUrl = bundleUrl - self.initiator = initiator - } - public enum CodingKeys: String, CodingKey { - case bundle - case repositoryId = "repository_id" - case bundleUrl = "bundle_url" - case initiator - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. - public typealias AttestationsPayload = [Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload] - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. - public var attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - attestations: - public init(attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? = nil) { - self.attestations = attestations - } - public enum CodingKeys: String, CodingKey { - case attestations - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// If the user is blocked + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCheckBlockedUser.Output.NoContent) + /// If the user is blocked + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/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.OrgsCheckBlockedUser.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}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload) + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/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: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -12940,33 +14633,181 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListAttestations.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsListAttestations.Output.Ok.Body) { + public init(body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body) { self.body = body } } + /// If the user is not blocked + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsCheckBlockedUser.Output.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: Operations.OrgsCheckBlockedUser.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Block a user from an organization + /// + /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// + /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. + public enum OrgsBlockUser { + public static let id: Swift.String = "orgs/block-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsBlockUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsBlockUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsBlockUser.Input.Path, + headers: Operations.OrgsBlockUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAttestations.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsBlockUser.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListAttestations.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/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.OrgsBlockUser.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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -13003,20 +14844,103 @@ public enum Operations { } } } - /// List users blocked by an organization + /// Unblock a user from an organization + /// + /// Unblocks the given user on behalf of the specified organization. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. + public enum OrgsUnblockUser { + public static let id: Swift.String = "orgs/unblock-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsUnblockUser.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsUnblockUser.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}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsUnblockUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/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.OrgsUnblockUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List failed organization invitations /// - /// List the users blocked by an organization. + /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. /// - /// - Remark: HTTP `GET /orgs/{org}/blocks`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. - public enum OrgsListBlockedUsers { - public static let id: Swift.String = "orgs/list-blocked-users" + /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. + public enum OrgsListFailedInvitations { + public static let id: Swift.String = "orgs/list-failed-invitations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13026,16 +14950,16 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListBlockedUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query`. + public var path: Operations.OrgsListFailedInvitations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/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}/blocks/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -13050,19 +14974,19 @@ public enum Operations { self.page = page } } - public var query: Operations.OrgsListBlockedUsers.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/header`. + public var query: Operations.OrgsListFailedInvitations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/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.OrgsListBlockedUsers.Input.Headers + public var headers: Operations.OrgsListFailedInvitations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13070,9 +14994,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListBlockedUsers.Input.Path, - query: Operations.OrgsListBlockedUsers.Input.Query = .init(), - headers: Operations.OrgsListBlockedUsers.Input.Headers = .init() + path: Operations.OrgsListFailedInvitations.Input.Path, + query: Operations.OrgsListFailedInvitations.Input.Query = .init(), + headers: Operations.OrgsListFailedInvitations.Input.Headers = .init() ) { self.path = path self.query = query @@ -13081,15 +15005,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: [Components.Schemas.OrganizationInvitation] { get throws { switch self { case let .json(body): @@ -13099,26 +15037,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListBlockedUsers.Output.Ok.Body + public var body: Operations.OrgsListFailedInvitations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsListBlockedUsers.Output.Ok.Body) { + public init( + headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(), + body: Operations.OrgsListFailedInvitations.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListBlockedUsers.Output.Ok) + case ok(Operations.OrgsListFailedInvitations.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.OrgsListBlockedUsers.Output.Ok { + public var ok: Operations.OrgsListFailedInvitations.Output.Ok { get throws { switch self { case let .ok(response): @@ -13131,6 +15074,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/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. @@ -13162,110 +15128,112 @@ public enum Operations { } } } - /// Check if a user is blocked by an organization + /// List organization webhooks /// - /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// List webhooks for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. - public enum OrgsCheckBlockedUser { - public static let id: Swift.String = "orgs/check-blocked-user" + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. + public enum OrgsListWebhooks { + public static let id: Swift.String = "orgs/list-webhooks" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/username`. - public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListWebhooks.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/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}/hooks/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}/hooks/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( - org: Components.Parameters.Org, - username: Components.Parameters.Username + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.username = username + self.perPage = perPage + self.page = page } } - public var path: Operations.OrgsCheckBlockedUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/header`. + public var query: Operations.OrgsListWebhooks.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/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.OrgsCheckBlockedUser.Input.Headers + public var headers: Operations.OrgsListWebhooks.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsCheckBlockedUser.Input.Path, - headers: Operations.OrgsCheckBlockedUser.Input.Headers = .init() + path: Operations.OrgsListWebhooks.Input.Path, + query: Operations.OrgsListWebhooks.Input.Query = .init(), + headers: Operations.OrgsListWebhooks.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// If the user is blocked - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCheckBlockedUser.Output.NoContent) - /// If the user is blocked - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/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.OrgsCheckBlockedUser.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}/hooks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } - } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content`. + /// Received HTTP response headers + public var headers: Operations.OrgsListWebhooks.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content/application\/json`. - case json(Components.Schemas.BasicError) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrgHook]) /// 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: [Components.Schemas.OrgHook] { get throws { switch self { case let .json(body): @@ -13275,26 +15243,54 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body - /// Creates a new `NotFound`. + public var body: Operations.OrgsListWebhooks.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body) { + public init( + headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(), + body: Operations.OrgsListWebhooks.Output.Ok.Body + ) { + self.headers = headers self.body = body } } - /// If the user is not blocked + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListWebhooks.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.OrgsListWebhooks.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsCheckBlockedUser.Output.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: Operations.OrgsCheckBlockedUser.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -13338,95 +15334,227 @@ public enum Operations { } } } - /// Block a user from an organization + /// Create an organization webhook /// - /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// Create a hook that posts payloads in JSON format. /// - /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. - public enum OrgsBlockUser { - public static let id: Swift.String = "orgs/block-user" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or + /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. + public enum OrgsCreateWebhook { + public static let id: Swift.String = "orgs/create-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/username`. - public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - username: Components.Parameters.Username - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.username = username } } - public var path: Operations.OrgsBlockUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/header`. + public var path: Operations.OrgsCreateWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/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.OrgsBlockUser.Input.Headers + public var headers: Operations.OrgsCreateWebhook.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Must be passed as "web". + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/name`. + public var name: Swift.String + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. + public struct ConfigPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/url`. + public var url: Components.Schemas.WebhookConfigUrl + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/username`. + public var username: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/password`. + public var password: Swift.String? + /// Creates a new `ConfigPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + /// - username: + /// - password: + public init( + url: Components.Schemas.WebhookConfigUrl, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil, + username: Swift.String? = nil, + password: Swift.String? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + self.username = username + self.password = password + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + case username + case password + } + } + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. + public var config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload + /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/events`. + public var events: [Swift.String]? + /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/active`. + public var active: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Must be passed as "web". + /// - config: Key/value pairs to provide settings for this webhook. + /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + public init( + name: Swift.String, + config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload, + events: [Swift.String]? = nil, + active: Swift.Bool? = nil + ) { + self.name = name + self.config = config + self.events = events + self.active = active + } + public enum CodingKeys: String, CodingKey { + case name + case config + case events + case active + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateWebhook.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateWebhook.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsBlockUser.Input.Path, - headers: Operations.OrgsBlockUser.Input.Headers = .init() + path: Operations.OrgsCreateWebhook.Input.Path, + headers: Operations.OrgsCreateWebhook.Input.Headers = .init(), + body: Operations.OrgsCreateWebhook.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsCreateWebhook.Output.Created.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OrgHook) + /// 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.OrgHook { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateWebhook.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(), + body: Operations.OrgsCreateWebhook.Output.Created.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsBlockUser.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.OrgsCreateWebhook.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsBlockUser.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OrgsCreateWebhook.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -13434,7 +15562,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -13445,11 +15573,34 @@ public enum Operations { public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .unprocessableContent(response): + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/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: "unprocessableContent", + expectedStatus: "notFound", response: self ) } @@ -13486,78 +15637,140 @@ public enum Operations { } } } - /// Unblock a user from an organization + /// Get an organization webhook /// - /// Unblocks the given user on behalf of the specified organization. + /// Returns a webhook configured in an organization. To get only the webhook + /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). /// - /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. - public enum OrgsUnblockUser { - public static let id: Swift.String = "orgs/unblock-user" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. + public enum OrgsGetWebhook { + public static let id: Swift.String = "orgs/get-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + hookId: Components.Parameters.HookId ) { self.org = org - self.username = username + self.hookId = hookId } } - public var path: Operations.OrgsUnblockUser.Input.Path + public var path: Operations.OrgsGetWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsGetWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsUnblockUser.Input.Path) { + /// - headers: + public init( + path: Operations.OrgsGetWebhook.Input.Path, + headers: Operations.OrgsGetWebhook.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrgHook) + /// 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.OrgHook { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsGetWebhook.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGetWebhook.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsUnblockUser.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/200`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetWebhook.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetWebhook.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Resource not found /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsUnblockUser.Output.NoContent { + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .noContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notFound", response: self ) } @@ -13568,108 +15781,197 @@ 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 failed organization invitations + /// Update an organization webhook /// - /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. + /// Updates a webhook configured in an organization. When you update a webhook, + /// the `secret` will be overwritten. If you previously had a `secret` set, you must + /// provide the same `secret` or set a new `secret` or the secret will be removed. If + /// you are only updating individual webhook `config` properties, use "[Update a webhook + /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". /// - /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. - public enum OrgsListFailedInvitations { - public static let id: Swift.String = "orgs/list-failed-invitations" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. + public enum OrgsUpdateWebhook { + public static let id: Swift.String = "orgs/update-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListFailedInvitations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/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}/failed_invitations/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)." + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId ) { - self.perPage = perPage - self.page = page + self.org = org + self.hookId = hookId } } - public var query: Operations.OrgsListFailedInvitations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/header`. + public var path: Operations.OrgsUpdateWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_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.OrgsListFailedInvitations.Input.Headers + public var headers: Operations.OrgsUpdateWebhook.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. + public struct ConfigPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/url`. + public var url: Components.Schemas.WebhookConfigUrl + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// Creates a new `ConfigPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + public init( + url: Components.Schemas.WebhookConfigUrl, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + } + } + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. + public var config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? + /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/events`. + public var events: [Swift.String]? + /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/active`. + public var active: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - config: Key/value pairs to provide settings for this webhook. + /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// - name: + public init( + config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? = nil, + events: [Swift.String]? = nil, + active: Swift.Bool? = nil, + name: Swift.String? = nil + ) { + self.config = config + self.events = events + self.active = active + self.name = name + } + public enum CodingKeys: String, CodingKey { + case config + case events + case active + case name + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdateWebhook.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdateWebhook.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.OrgsListFailedInvitations.Input.Path, - query: Operations.OrgsListFailedInvitations.Input.Query = .init(), - headers: Operations.OrgsListFailedInvitations.Input.Headers = .init() + path: Operations.OrgsUpdateWebhook.Input.Path, + headers: Operations.OrgsUpdateWebhook.Input.Headers = .init(), + body: Operations.OrgsUpdateWebhook.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.OrgHook) /// 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.OrganizationInvitation] { + public var json: Components.Schemas.OrgHook { get throws { switch self { case let .json(body): @@ -13679,31 +15981,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListFailedInvitations.Output.Ok.Body + public var body: Operations.OrgsUpdateWebhook.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(), - body: Operations.OrgsListFailedInvitations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsUpdateWebhook.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListFailedInvitations.Output.Ok) + case ok(Operations.OrgsUpdateWebhook.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.OrgsListFailedInvitations.Output.Ok { + public var ok: Operations.OrgsUpdateWebhook.Output.Ok { get throws { switch self { case let .ok(response): @@ -13716,9 +16013,32 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -13770,153 +16090,100 @@ public enum Operations { } } } - /// List organization webhooks + /// Delete an organization webhook /// - /// List webhooks for an organization. + /// Delete a webhook for an organization. /// /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. - public enum OrgsListWebhooks { - public static let id: Swift.String = "orgs/list-webhooks" + /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. + public enum OrgsDeleteWebhook { + public static let id: Swift.String = "orgs/delete-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListWebhooks.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/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}/hooks/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}/hooks/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)." + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId ) { - self.perPage = perPage - self.page = page + self.org = org + self.hookId = hookId } } - public var query: Operations.OrgsListWebhooks.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/header`. + public var path: Operations.OrgsDeleteWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_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.OrgsListWebhooks.Input.Headers + public var headers: Operations.OrgsDeleteWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListWebhooks.Input.Path, - query: Operations.OrgsListWebhooks.Input.Query = .init(), - headers: Operations.OrgsListWebhooks.Input.Headers = .init() + path: Operations.OrgsDeleteWebhook.Input.Path, + headers: Operations.OrgsDeleteWebhook.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}/hooks/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/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.OrgsListWebhooks.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrgHook]) - /// 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.OrgHook] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListWebhooks.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(), - body: Operations.OrgsListWebhooks.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListWebhooks.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteWebhook.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/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.OrgsListWebhooks.Output.Ok { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDeleteWebhook.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 ) } @@ -13924,7 +16191,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -13976,186 +16243,80 @@ public enum Operations { } } } - /// Create an organization webhook + /// Get a webhook configuration for an organization /// - /// Create a hook that posts payloads in JSON format. + /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." /// /// You must be an organization owner to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or - /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. - public enum OrgsCreateWebhook { - public static let id: Swift.String = "orgs/create-webhook" + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. + public enum OrgsGetWebhookConfigForOrg { + public static let id: Swift.String = "orgs/get-webhook-config-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + public init( + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId + ) { self.org = org + self.hookId = hookId } } - public var path: Operations.OrgsCreateWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/header`. + public var path: Operations.OrgsGetWebhookConfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/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.OrgsCreateWebhook.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Must be passed as "web". - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/name`. - public var name: Swift.String - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. - public struct ConfigPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/url`. - public var url: Components.Schemas.WebhookConfigUrl - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/username`. - public var username: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/password`. - public var password: Swift.String? - /// Creates a new `ConfigPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - /// - username: - /// - password: - public init( - url: Components.Schemas.WebhookConfigUrl, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil, - username: Swift.String? = nil, - password: Swift.String? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - self.username = username - self.password = password - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - case username - case password - } - } - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. - public var config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload - /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/events`. - public var events: [Swift.String]? - /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/active`. - public var active: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Must be passed as "web". - /// - config: Key/value pairs to provide settings for this webhook. - /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. - /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - public init( - name: Swift.String, - config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload, - events: [Swift.String]? = nil, - active: Swift.Bool? = nil - ) { - self.name = name - self.config = config - self.events = events - self.active = active - } - public enum CodingKeys: String, CodingKey { - case name - case config - case events - case active - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/content/application\/json`. - case json(Operations.OrgsCreateWebhook.Input.Body.JsonPayload) - } - public var body: Operations.OrgsCreateWebhook.Input.Body + public var headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsCreateWebhook.Input.Path, - headers: Operations.OrgsCreateWebhook.Input.Headers = .init(), - body: Operations.OrgsCreateWebhook.Input.Body + path: Operations.OrgsGetWebhookConfigForOrg.Input.Path, + headers: Operations.OrgsGetWebhookConfigForOrg.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}/hooks/POST/responses/201/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsCreateWebhook.Output.Created.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content/application\/json`. - case json(Components.Schemas.OrgHook) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content/application\/json`. + case json(Components.Schemas.WebhookConfig) /// 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.OrgHook { + public var json: Components.Schemas.WebhookConfig { get throws { switch self { case let .json(body): @@ -14165,84 +16326,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateWebhook.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(), - body: Operations.OrgsCreateWebhook.Output.Created.Body - ) { - self.headers = headers + public init(body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.OrgsCreateWebhook.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.OrgsCreateWebhook.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)/responses/200`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetWebhookConfigForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetWebhookConfigForOrg.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -14279,30 +16389,29 @@ public enum Operations { } } } - /// Get an organization webhook + /// Update a webhook configuration for an organization /// - /// Returns a webhook configured in an organization. To get only the webhook - /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). + /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. - public enum OrgsGetWebhook { - public static let id: Swift.String = "orgs/get-webhook" + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. + public enum OrgsUpdateWebhookConfigForOrg { + public static let id: Swift.String = "orgs/update-webhook-config-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/hook_id`. public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// @@ -14317,43 +16426,87 @@ public enum Operations { self.hookId = hookId } } - public var path: Operations.OrgsGetWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/header`. + public var path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/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.OrgsGetWebhook.Input.Headers + public var headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/url`. + public var url: Components.Schemas.WebhookConfigUrl? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + public init( + url: Components.Schemas.WebhookConfigUrl? = nil, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdateWebhookConfigForOrg.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsGetWebhook.Input.Path, - headers: Operations.OrgsGetWebhook.Input.Headers = .init() + path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path, + headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers = .init(), + body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? = nil ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrgHook) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.WebhookConfig) /// 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.OrgHook { + public var json: Components.Schemas.WebhookConfig { get throws { switch self { case let .json(body): @@ -14363,26 +16516,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetWebhook.Output.Ok.Body + public var body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhook.Output.Ok.Body) { + public init(body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhook.Output.Ok) + case ok(Operations.OrgsUpdateWebhookConfigForOrg.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.OrgsGetWebhook.Output.Ok { + public var ok: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -14395,29 +16548,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/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. @@ -14449,171 +16579,107 @@ public enum Operations { } } } - /// Update an organization webhook - /// - /// Updates a webhook configured in an organization. When you update a webhook, - /// the `secret` will be overwritten. If you previously had a `secret` set, you must - /// provide the same `secret` or set a new `secret` or the secret will be removed. If - /// you are only updating individual webhook `config` properties, use "[Update a webhook - /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". - /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. - public enum OrgsUpdateWebhook { - public static let id: Swift.String = "orgs/update-webhook" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId - ) { - self.org = org - self.hookId = hookId - } - } - public var path: Operations.OrgsUpdateWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsUpdateWebhook.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. - public struct ConfigPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/url`. - public var url: Components.Schemas.WebhookConfigUrl - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// Creates a new `ConfigPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - public init( - url: Components.Schemas.WebhookConfigUrl, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - } - } - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. - public var config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? - /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/events`. - public var events: [Swift.String]? - /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/active`. - public var active: Swift.Bool? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - config: Key/value pairs to provide settings for this webhook. - /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - name: - public init( - config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? = nil, - events: [Swift.String]? = nil, - active: Swift.Bool? = nil, - name: Swift.String? = nil - ) { - self.config = config - self.events = events - self.active = active - self.name = name - } - public enum CodingKeys: String, CodingKey { - case config - case events - case active - case name - } + /// List deliveries for an organization webhook + /// + /// Returns a list of webhook deliveries for a webhook configured in an organization. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. + public enum OrgsListWebhookDeliveries { + public static let id: Swift.String = "orgs/list-webhook-deliveries" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + public init( + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId + ) { + self.org = org + self.hookId = hookId } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdateWebhook.Input.Body.JsonPayload) } - public var body: Operations.OrgsUpdateWebhook.Input.Body? + public var path: Operations.OrgsListWebhookDeliveries.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/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}/hooks/{hook_id}/deliveries/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. + public var cursor: Components.Parameters.Cursor? + /// 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)." + /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + public init( + perPage: Components.Parameters.PerPage? = nil, + cursor: Components.Parameters.Cursor? = nil + ) { + self.perPage = perPage + self.cursor = cursor + } + } + public var query: Operations.OrgsListWebhookDeliveries.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListWebhookDeliveries.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.OrgsUpdateWebhook.Input.Path, - headers: Operations.OrgsUpdateWebhook.Input.Headers = .init(), - body: Operations.OrgsUpdateWebhook.Input.Body? = nil + path: Operations.OrgsListWebhookDeliveries.Input.Path, + query: Operations.OrgsListWebhookDeliveries.Input.Query = .init(), + headers: Operations.OrgsListWebhookDeliveries.Input.Headers = .init() ) { 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}/hooks/{hook_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.OrgHook) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content/application\/json`. + case json([Components.Schemas.HookDeliveryItem]) /// 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.OrgHook { + public var json: [Components.Schemas.HookDeliveryItem] { get throws { switch self { case let .json(body): @@ -14623,26 +16689,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdateWebhook.Output.Ok.Body + public var body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdateWebhook.Output.Ok.Body) { + public init(body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdateWebhook.Output.Ok) + case ok(Operations.OrgsListWebhookDeliveries.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.OrgsUpdateWebhook.Output.Ok { + public var ok: Operations.OrgsListWebhookDeliveries.Output.Ok { get throws { switch self { case let .ok(response): @@ -14655,47 +16721,47 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Bad Request /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/400`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .unprocessableContent(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -14708,11 +16774,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -14723,132 +16792,179 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Delete an organization webhook + /// Get a webhook delivery for an organization webhook /// - /// Delete a webhook for an organization. + /// Returns a delivery for a webhook configured in an organization. /// - /// The authenticated user must be an organization owner to use this endpoint. + /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. - public enum OrgsDeleteWebhook { - public static let id: Swift.String = "orgs/delete-webhook" + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. + public enum OrgsGetWebhookDelivery { + public static let id: Swift.String = "orgs/get-webhook-delivery" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/hook_id`. public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/delivery_id`. + public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - deliveryId: public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + hookId: Components.Parameters.HookId, + deliveryId: Components.Parameters.DeliveryId ) { self.org = org self.hookId = hookId + self.deliveryId = deliveryId } } - public var path: Operations.OrgsDeleteWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/header`. + public var path: Operations.OrgsGetWebhookDelivery.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_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.OrgsDeleteWebhook.Input.Headers + public var headers: Operations.OrgsGetWebhookDelivery.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsDeleteWebhook.Input.Path, - headers: Operations.OrgsDeleteWebhook.Input.Headers = .init() + path: Operations.OrgsGetWebhookDelivery.Input.Path, + headers: Operations.OrgsGetWebhookDelivery.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.HookDelivery) + /// 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.HookDelivery { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsDeleteWebhook.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/200`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetWebhookDelivery.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetWebhookDelivery.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsDeleteWebhook.Output.NoContent { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .noContent(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -14861,11 +16977,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -14876,125 +16995,151 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get a webhook configuration for an organization + /// Redeliver a delivery for an organization webhook /// - /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." + /// Redeliver a delivery for a webhook configured in an organization. /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. - public enum OrgsGetWebhookConfigForOrg { - public static let id: Swift.String = "orgs/get-webhook-config-for-org" + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. + public enum OrgsRedeliverWebhookDelivery { + public static let id: Swift.String = "orgs/redeliver-webhook-delivery" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. + public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - deliveryId: public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + hookId: Components.Parameters.HookId, + deliveryId: Components.Parameters.DeliveryId ) { self.org = org self.hookId = hookId + self.deliveryId = deliveryId } } - public var path: Operations.OrgsGetWebhookConfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/header`. + public var path: Operations.OrgsRedeliverWebhookDelivery.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + 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.OrgsGetWebhookConfigForOrg.Input.Headers + public var headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetWebhookConfigForOrg.Input.Path, - headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers = .init() + path: Operations.OrgsRedeliverWebhookDelivery.Input.Path, + headers: Operations.OrgsRedeliverWebhookDelivery.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}/hooks/{hook_id}/config/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content/application\/json`. - case json(Components.Schemas.WebhookConfig) - /// 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.WebhookConfig { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body) { - self.body = body + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhookConfigForOrg.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.OrgsGetWebhookConfigForOrg.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 ) } @@ -15007,11 +17152,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -15022,169 +17170,136 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Update a webhook configuration for an organization + /// Ping an organization webhook /// - /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." + /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) + /// to be sent to the hook. /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. - public enum OrgsUpdateWebhookConfigForOrg { - public static let id: Swift.String = "orgs/update-webhook-config-for-org" + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. + public enum OrgsPingWebhook { + public static let id: Swift.String = "orgs/ping-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId - ) { - self.org = org - self.hookId = hookId - } - } - public var path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/url`. - public var url: Components.Schemas.WebhookConfigUrl? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - public init( - url: Components.Schemas.WebhookConfigUrl? = nil, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - } + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. + public var hookId: Components.Parameters.HookId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + public init( + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId + ) { + self.org = org + self.hookId = hookId } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdateWebhookConfigForOrg.Input.Body.JsonPayload) } - public var body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? + public var path: Operations.OrgsPingWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsPingWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path, - headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers = .init(), - body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? = nil + path: Operations.OrgsPingWebhook.Input.Path, + headers: Operations.OrgsPingWebhook.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}/hooks/{hook_id}/config/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.WebhookConfig) - /// 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.WebhookConfig { - 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}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsPingWebhook.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/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.OrgsPingWebhook.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.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -15221,80 +17336,141 @@ public enum Operations { } } } - /// List deliveries for an organization webhook - /// - /// Returns a list of webhook deliveries for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get route stats by actor /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request count statistics for an actor broken down by route within a specified time frame. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. - public enum OrgsListWebhookDeliveries { - public static let id: Swift.String = "orgs/list-webhook-deliveries" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public enum ApiInsightsGetRouteStatsByActor { + public static let id: Swift.String = "api-insights/get-route-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { + case installation = "installation" + case classicPat = "classic_pat" + case fineGrainedPat = "fine_grained_pat" + case oauthApp = "oauth_app" + case githubAppUserToServer = "github_app_user_to_server" + } + /// The type of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/hook_id`. - public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actorType: Components.Parameters.ApiInsightsActorType + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - actorType: The type of the actor + /// - actorId: The ID of the actor public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + actorType: Components.Parameters.ApiInsightsActorType, + actorId: Components.Parameters.ApiInsightsActorId ) { self.org = org - self.hookId = hookId + self.actorType = actorType + self.actorId = actorId } } - public var path: Operations.OrgsListWebhookDeliveries.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query`. + public var path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. + public var page: Components.Parameters.Page? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? - /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. - public var cursor: Components.Parameters.Cursor? + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsRouteStatsSort`. + @frozen public enum ApiInsightsRouteStatsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case httpMethod = "http_method" + case apiRoute = "api_route" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias ApiInsightsRouteStatsSort = [Components.Parameters.ApiInsightsRouteStatsSortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsRouteStatsSort? + /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/api_route_substring`. + public var apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? /// Creates a new `Query`. /// /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - 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)." - /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - apiRouteSubstring: Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. public init( + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, perPage: Components.Parameters.PerPage? = nil, - cursor: Components.Parameters.Cursor? = nil + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsRouteStatsSort? = nil, + apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? = nil ) { + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + self.page = page self.perPage = perPage - self.cursor = cursor + self.direction = direction + self.sort = sort + self.apiRouteSubstring = apiRouteSubstring } } - public var query: Operations.OrgsListWebhookDeliveries.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/header`. + public var query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + 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.OrgsListWebhookDeliveries.Input.Headers + public var headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -15302,9 +17478,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListWebhookDeliveries.Input.Path, - query: Operations.OrgsListWebhookDeliveries.Input.Query = .init(), - headers: Operations.OrgsListWebhookDeliveries.Input.Headers = .init() + path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path, + query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers = .init() ) { self.path = path self.query = query @@ -15313,15 +17489,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content/application\/json`. - case json([Components.Schemas.HookDeliveryItem]) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsRouteStats) /// 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.HookDeliveryItem] { + public var json: Components.Schemas.ApiInsightsRouteStats { get throws { switch self { case let .json(body): @@ -15331,26 +17507,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body + public var body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListWebhookDeliveries.Output.Ok) + case ok(Operations.ApiInsightsGetRouteStatsByActor.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.OrgsListWebhookDeliveries.Output.Ok { + public var ok: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok { get throws { switch self { case let .ok(response): @@ -15363,52 +17539,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/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. @@ -15416,14 +17546,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -15434,97 +17561,152 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Get a webhook delivery for an organization webhook - /// - /// Returns a delivery for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get subject stats /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. - public enum OrgsGetWebhookDelivery { - public static let id: Swift.String = "orgs/get-webhook-delivery" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public enum ApiInsightsGetSubjectStats { + public static let id: Swift.String = "api-insights/get-subject-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/delivery_id`. - public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - deliveryId: + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ApiInsightsGetSubjectStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. + @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case subjectName = "subject_name" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsSort? + /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/subject_name_substring`. + public var subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - 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)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - subjectNameSubstring: Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId, - deliveryId: Components.Parameters.DeliveryId + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil, + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsSort? = nil, + subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? = nil ) { - self.org = org - self.hookId = hookId - self.deliveryId = deliveryId + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + self.page = page + self.perPage = perPage + self.direction = direction + self.sort = sort + self.subjectNameSubstring = subjectNameSubstring } } - public var path: Operations.OrgsGetWebhookDelivery.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/header`. + public var query: Operations.ApiInsightsGetSubjectStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/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.OrgsGetWebhookDelivery.Input.Headers + public var headers: Operations.ApiInsightsGetSubjectStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsGetWebhookDelivery.Input.Path, - headers: Operations.OrgsGetWebhookDelivery.Input.Headers = .init() + path: Operations.ApiInsightsGetSubjectStats.Input.Path, + query: Operations.ApiInsightsGetSubjectStats.Input.Query, + headers: Operations.ApiInsightsGetSubjectStats.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}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.HookDelivery) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSubjectStats) /// 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.HookDelivery { + public var json: Components.Schemas.ApiInsightsSubjectStats { get throws { switch self { case let .json(body): @@ -15534,79 +17716,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body + public var body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhookDelivery.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.OrgsGetWebhookDelivery.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/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.ApiInsightsGetSubjectStats.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.ApiInsightsGetSubjectStats.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 ) } @@ -15619,14 +17755,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -15637,151 +17770,138 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Redeliver a delivery for an organization webhook - /// - /// Redeliver a delivery for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get summary stats /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. - public enum OrgsRedeliverWebhookDelivery { - public static let id: Swift.String = "orgs/redeliver-webhook-delivery" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public enum ApiInsightsGetSummaryStats { + public static let id: Swift.String = "api-insights/get-summary-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. - public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - deliveryId: + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ApiInsightsGetSummaryStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId, - deliveryId: Components.Parameters.DeliveryId + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil ) { - self.org = org - self.hookId = hookId - self.deliveryId = deliveryId + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp } } - public var path: Operations.OrgsRedeliverWebhookDelivery.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. + public var query: Operations.ApiInsightsGetSummaryStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/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.OrgsRedeliverWebhookDelivery.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsRedeliverWebhookDelivery.Input.Path, - headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStats.Input.Path, + query: Operations.ApiInsightsGetSummaryStats.Input.Query, + headers: Operations.ApiInsightsGetSummaryStats.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Accepted - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. - /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. - /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { - get throws { - switch self { - case let .accepted(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "accepted", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) + /// 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.ApiInsightsSummaryStats { + get throws { + switch self { + case let .json(body): + return body + } + } } } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } + /// Received HTTP response body + public var body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body) { + self.body = body } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/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.ApiInsightsGetSummaryStats.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.ApiInsightsGetSummaryStats.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 ) } @@ -15794,14 +17914,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -15812,136 +17929,147 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Ping an organization webhook - /// - /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) - /// to be sent to the hook. - /// - /// You must be an organization owner to use this endpoint. + /// Get summary stats by user /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get overall statistics of API requests within the organization for a user. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. - public enum OrgsPingWebhook { - public static let id: Swift.String = "orgs/ping-webhook" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public enum ApiInsightsGetSummaryStatsByUser { + public static let id: Swift.String = "api-insights/get-summary-stats-by-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// The ID of the user to query for stats /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. - public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. + public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - userId: The ID of the user to query for stats public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + userId: Components.Parameters.ApiInsightsUserId ) { self.org = org - self.hookId = hookId + self.userId = userId } } - public var path: Operations.OrgsPingWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. + public var path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + ) { + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + } + } + public var query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + 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.OrgsPingWebhook.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsPingWebhook.Input.Path, - headers: Operations.OrgsPingWebhook.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path, + query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query, + headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsPingWebhook.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/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.OrgsPingWebhook.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) + /// 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.ApiInsightsSummaryStats { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body) { + self.body = body + } } - /// Resource not found + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `200 ok`. + case ok(Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -15978,20 +18106,20 @@ public enum Operations { } } } - /// Get route stats by actor + /// Get summary stats by actor /// - /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. - public enum ApiInsightsGetRouteStatsByActor { - public static let id: Swift.String = "api-insights/get-route-stats-by-actor" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public enum ApiInsightsGetSummaryStatsByActor { + public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { @@ -16003,11 +18131,11 @@ public enum Operations { } /// The type of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. public var actorType: Components.Parameters.ApiInsightsActorType /// The ID of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// @@ -16025,94 +18153,43 @@ public enum Operations { self.actorId = actorId } } - public var path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. + public var path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsRouteStatsSort`. - @frozen public enum ApiInsightsRouteStatsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case httpMethod = "http_method" - case apiRoute = "api_route" - case totalRequestCount = "total_request_count" - } - /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. - public typealias ApiInsightsRouteStatsSort = [Components.Parameters.ApiInsightsRouteStatsSortPayload] - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsRouteStatsSort? - /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/api_route_substring`. - public var apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - apiRouteSubstring: Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsRouteStatsSort? = nil, - apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp - self.page = page - self.perPage = perPage - self.direction = direction - self.sort = sort - self.apiRouteSubstring = apiRouteSubstring } } - public var query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. + public var query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + 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.ApiInsightsGetRouteStatsByActor.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16120,9 +18197,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path, - query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path, + query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers = .init() ) { self.path = path self.query = query @@ -16131,15 +18208,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsRouteStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) /// 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.ApiInsightsRouteStats { + public var json: Components.Schemas.ApiInsightsSummaryStats { get throws { switch self { case let .json(body): @@ -16149,26 +18226,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body + public var body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetRouteStatsByActor.Output.Ok) + case ok(Operations.ApiInsightsGetSummaryStatsByActor.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.ApiInsightsGetRouteStatsByActor.Output.Ok { + public var ok: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok { get throws { switch self { case let .ok(response): @@ -16212,116 +18289,73 @@ public enum Operations { } } } - /// Get subject stats + /// Get time stats /// - /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. - public enum ApiInsightsGetSubjectStats { - public static let id: Swift.String = "api-insights/get-subject-stats" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public enum ApiInsightsGetTimeStats { + public static let id: Swift.String = "api-insights/get-time-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ApiInsightsGetSubjectStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. - public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. - @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case subjectName = "subject_name" - case totalRequestCount = "total_request_count" + self.org = org } - /// - Remark: Generated from `#/components/parameters/api-insights-sort`. - public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] - /// The property to sort the results by. + } + public var path: Operations.ApiInsightsGetTimeStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsSort? - /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/subject_name_substring`. - public var subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - subjectNameSubstring: Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsSort? = nil, - subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? = nil + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp - self.page = page - self.perPage = perPage - self.direction = direction - self.sort = sort - self.subjectNameSubstring = subjectNameSubstring + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetSubjectStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/header`. + public var query: Operations.ApiInsightsGetTimeStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/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.ApiInsightsGetSubjectStats.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16329,9 +18363,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSubjectStats.Input.Path, - query: Operations.ApiInsightsGetSubjectStats.Input.Query, - headers: Operations.ApiInsightsGetSubjectStats.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStats.Input.Path, + query: Operations.ApiInsightsGetTimeStats.Input.Query, + headers: Operations.ApiInsightsGetTimeStats.Input.Headers = .init() ) { self.path = path self.query = query @@ -16340,15 +18374,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSubjectStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// 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.ApiInsightsSubjectStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -16358,26 +18392,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSubjectStats.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStats.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.ApiInsightsGetSubjectStats.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -16421,66 +18455,82 @@ public enum Operations { } } } - /// Get summary stats + /// Get time stats by user /// - /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. - public enum ApiInsightsGetSummaryStats { - public static let id: Swift.String = "api-insights/get-summary-stats" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public enum ApiInsightsGetTimeStatsByUser { + public static let id: Swift.String = "api-insights/get-time-stats-by-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. public var org: Components.Parameters.Org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. + public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - userId: The ID of the user to query for stats + public init( + org: Components.Parameters.Org, + userId: Components.Parameters.ApiInsightsUserId + ) { self.org = org + self.userId = userId } } - public var path: Operations.ApiInsightsGetSummaryStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public var path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetSummaryStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/header`. + public var query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + 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.ApiInsightsGetSummaryStats.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16488,9 +18538,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStats.Input.Path, - query: Operations.ApiInsightsGetSummaryStats.Input.Query, - headers: Operations.ApiInsightsGetSummaryStats.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path, + query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query, + headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers = .init() ) { self.path = path self.query = query @@ -16499,15 +18549,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// 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.ApiInsightsSummaryStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -16517,26 +18567,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStats.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStatsByUser.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.ApiInsightsGetSummaryStats.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -16580,75 +18630,97 @@ public enum Operations { } } } - /// Get summary stats by user + /// Get time stats by actor /// - /// Get overall statistics of API requests within the organization for a user. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. - public enum ApiInsightsGetSummaryStatsByUser { - public static let id: Swift.String = "api-insights/get-summary-stats-by-user" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public enum ApiInsightsGetTimeStatsByActor { + public static let id: Swift.String = "api-insights/get-time-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The ID of the user to query for stats + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { + case installation = "installation" + case classicPat = "classic_pat" + case fineGrainedPat = "fine_grained_pat" + case oauthApp = "oauth_app" + case githubAppUserToServer = "github_app_user_to_server" + } + /// The type of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. - public var userId: Components.Parameters.ApiInsightsUserId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actorType: Components.Parameters.ApiInsightsActorType + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - userId: The ID of the user to query for stats + /// - actorType: The type of the actor + /// - actorId: The ID of the actor public init( org: Components.Parameters.Org, - userId: Components.Parameters.ApiInsightsUserId + actorType: Components.Parameters.ApiInsightsActorType, + actorId: Components.Parameters.ApiInsightsActorId ) { self.org = org - self.userId = userId + self.actorType = actorType + self.actorId = actorId } } - public var path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public var path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. + public var query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16656,9 +18728,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path, - query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query, - headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path, + query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers = .init() ) { self.path = path self.query = query @@ -16667,15 +18739,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// 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.ApiInsightsSummaryStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -16685,26 +18757,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStatsByActor.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.ApiInsightsGetSummaryStatsByUser.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok { get throws { switch self { case let .ok(response): @@ -16748,90 +18820,125 @@ public enum Operations { } } } - /// Get summary stats by actor - /// - /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// Get user stats /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. - public enum ApiInsightsGetSummaryStatsByActor { - public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public enum ApiInsightsGetUserStats { + public static let id: Swift.String = "api-insights/get-user-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. public var org: Components.Parameters.Org - /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. - @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { - case installation = "installation" - case classicPat = "classic_pat" - case fineGrainedPat = "fine_grained_pat" - case oauthApp = "oauth_app" - case githubAppUserToServer = "github_app_user_to_server" - } - /// The type of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. - public var actorType: Components.Parameters.ApiInsightsActorType - /// The ID of the actor + /// The ID of the user to query for stats /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. - public var actorId: Components.Parameters.ApiInsightsActorId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. + public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - actorType: The type of the actor - /// - actorId: The ID of the actor + /// - userId: The ID of the user to query for stats public init( org: Components.Parameters.Org, - actorType: Components.Parameters.ApiInsightsActorType, - actorId: Components.Parameters.ApiInsightsActorId + userId: Components.Parameters.ApiInsightsUserId ) { self.org = org - self.actorType = actorType - self.actorId = actorId + self.userId = userId } } - public var path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. + public var path: Operations.ApiInsightsGetUserStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. + @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case subjectName = "subject_name" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsSort? + /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/actor_name_substring`. + public var actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - 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)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - actorNameSubstring: Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil, + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsSort? = nil, + actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? = nil ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp + self.page = page + self.perPage = perPage + self.direction = direction + self.sort = sort + self.actorNameSubstring = actorNameSubstring } } - public var query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. + public var query: Operations.ApiInsightsGetUserStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers + public var headers: Operations.ApiInsightsGetUserStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16839,9 +18946,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path, - query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers = .init() + path: Operations.ApiInsightsGetUserStats.Input.Path, + query: Operations.ApiInsightsGetUserStats.Input.Query, + headers: Operations.ApiInsightsGetUserStats.Input.Headers = .init() ) { self.path = path self.query = query @@ -16850,15 +18957,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsUserStats) /// 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.ApiInsightsSummaryStats { + public var json: Components.Schemas.ApiInsightsUserStats { get throws { switch self { case let .json(body): @@ -16868,26 +18975,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body + public var body: Operations.ApiInsightsGetUserStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetUserStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok) + case ok(Operations.ApiInsightsGetUserStats.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.ApiInsightsGetSummaryStatsByActor.Output.Ok { + public var ok: Operations.ApiInsightsGetUserStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -16931,20 +19038,25 @@ public enum Operations { } } } - /// Get time stats + /// List app installations for an organization /// - /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// Lists all GitHub Apps in an organization. The installation count includes + /// all GitHub Apps installed on repositories in the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. - public enum ApiInsightsGetTimeStats { - public static let id: Swift.String = "api-insights/get-time-stats" + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/installations`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. + public enum OrgsListAppInstallations { + public static let id: Swift.String = "orgs/list-app-installations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16954,50 +19066,43 @@ public enum Operations { self.org = org } } - public var path: Operations.ApiInsightsGetTimeStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. + public var path: Operations.OrgsListAppInstallations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query`. public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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}/insights/api/time-stats/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/page`. + public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - 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( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement + self.perPage = perPage + self.page = page } } - public var query: Operations.ApiInsightsGetTimeStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/header`. + public var query: Operations.OrgsListAppInstallations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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.ApiInsightsGetTimeStats.Input.Headers + public var headers: Operations.OrgsListAppInstallations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -17005,9 +19110,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetTimeStats.Input.Path, - query: Operations.ApiInsightsGetTimeStats.Input.Query, - headers: Operations.ApiInsightsGetTimeStats.Input.Headers = .init() + path: Operations.OrgsListAppInstallations.Input.Path, + query: Operations.OrgsListAppInstallations.Input.Query = .init(), + headers: Operations.OrgsListAppInstallations.Input.Headers = .init() ) { self.path = path self.query = query @@ -17016,15 +19121,52 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListAppInstallations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. + public var installations: [Components.Schemas.Installation] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - installations: + public init( + totalCount: Swift.Int, + installations: [Components.Schemas.Installation] + ) { + self.totalCount = totalCount + self.installations = installations + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case installations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAppInstallations.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.ApiInsightsTimeStats { + public var json: Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -17034,26 +19176,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body + public var body: Operations.OrgsListAppInstallations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body) { + public init( + headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(), + body: Operations.OrgsListAppInstallations.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStats.Output.Ok) + case ok(Operations.OrgsListAppInstallations.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.ApiInsightsGetTimeStats.Output.Ok { + public var ok: Operations.OrgsListAppInstallations.Output.Ok { get throws { switch self { case let .ok(response): @@ -17097,82 +19244,97 @@ public enum Operations { } } } - /// Get time stats by user + /// List pending organization invitations /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// The return hash contains a `role` field which refers to the Organization + /// Invitation role and will be one of the following values: `direct_member`, `admin`, + /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub + /// member, the `login` field in the return hash will be `null`. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. - public enum ApiInsightsGetTimeStatsByUser { - public static let id: Swift.String = "api-insights/get-time-stats-by-user" + /// - Remark: HTTP `GET /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. + public enum OrgsListPendingInvitations { + public static let id: Swift.String = "orgs/list-pending-invitations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path/org`. public var org: Components.Parameters.Org - /// The ID of the user to query for stats - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. - public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - userId: The ID of the user to query for stats - public init( - org: Components.Parameters.Org, - userId: Components.Parameters.ApiInsightsUserId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.userId = userId } } - public var path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. + public var path: Operations.OrgsListPendingInvitations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query`. public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/page`. + public var page: Components.Parameters.Page? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case admin = "admin" + case directMember = "direct_member" + case billingManager = "billing_manager" + case hiringManager = "hiring_manager" + } + /// Filter invitations by their member role. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + public var role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + @frozen public enum InvitationSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case member = "member" + case scim = "scim" + } + /// Filter invitations by their invitation source. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + public var invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? /// Creates a new `Query`. /// /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - 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)." + /// - role: Filter invitations by their member role. + /// - invitationSource: Filter invitations by their invitation source. public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? = nil, + invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? = nil ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement + self.perPage = perPage + self.page = page + self.role = role + self.invitationSource = invitationSource } } - public var query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. + public var query: Operations.OrgsListPendingInvitations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.ApiInsightsGetTimeStatsByUser.Input.Headers + public var headers: Operations.OrgsListPendingInvitations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -17180,9 +19342,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path, - query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query, - headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers = .init() + path: Operations.OrgsListPendingInvitations.Input.Path, + query: Operations.OrgsListPendingInvitations.Input.Query = .init(), + headers: Operations.OrgsListPendingInvitations.Input.Headers = .init() ) { self.path = path self.query = query @@ -17191,15 +19353,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) /// 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.ApiInsightsTimeStats { + public var json: [Components.Schemas.OrganizationInvitation] { get throws { switch self { case let .json(body): @@ -17209,26 +19385,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body + public var body: Operations.OrgsListPendingInvitations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body) { + public init( + headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(), + body: Operations.OrgsListPendingInvitations.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStatsByUser.Output.Ok) + case ok(Operations.OrgsListPendingInvitations.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.ApiInsightsGetTimeStatsByUser.Output.Ok { + public var ok: Operations.OrgsListPendingInvitations.Output.Ok { get throws { switch self { case let .ok(response): @@ -17241,6 +19422,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.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. @@ -17272,124 +19476,138 @@ public enum Operations { } } } - /// Get time stats by actor + /// Create an organization invitation /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. - public enum ApiInsightsGetTimeStatsByActor { - public static let id: Swift.String = "api-insights/get-time-stats-by-actor" + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. + public enum OrgsCreateInvitation { + public static let id: Swift.String = "orgs/create-invitation" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path/org`. public var org: Components.Parameters.Org - /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. - @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { - case installation = "installation" - case classicPat = "classic_pat" - case fineGrainedPat = "fine_grained_pat" - case oauthApp = "oauth_app" - case githubAppUserToServer = "github_app_user_to_server" - } - /// The type of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. - public var actorType: Components.Parameters.ApiInsightsActorType - /// The ID of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. - public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - actorType: The type of the actor - /// - actorId: The ID of the actor - public init( - org: Components.Parameters.Org, - actorType: Components.Parameters.ApiInsightsActorType, - actorId: Components.Parameters.ApiInsightsActorId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.actorType = actorType - self.actorId = actorId - } - } - public var path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - /// Creates a new `Query`. - /// - /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. + public var path: Operations.OrgsCreateInvitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.ApiInsightsGetTimeStatsByActor.Input.Headers + public var headers: Operations.OrgsCreateInvitation.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. + public var inviteeId: Swift.Int? + /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. + public var email: Swift.String? + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case admin = "admin" + case directMember = "direct_member" + case billingManager = "billing_manager" + case reinstate = "reinstate" + } + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + public var role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? + /// Specify IDs for the teams you want to invite new members to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. + public var teamIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - inviteeId: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// - role: The role for the new member. + /// - teamIds: Specify IDs for the teams you want to invite new members to. + public init( + inviteeId: Swift.Int? = nil, + email: Swift.String? = nil, + role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? = nil, + teamIds: [Swift.Int]? = nil + ) { + self.inviteeId = inviteeId + self.email = email + self.role = role + self.teamIds = teamIds + } + public enum CodingKeys: String, CodingKey { + case inviteeId = "invitee_id" + case email + case role + case teamIds = "team_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateInvitation.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateInvitation.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path, - query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers = .init() + path: Operations.OrgsCreateInvitation.Input.Path, + headers: Operations.OrgsCreateInvitation.Input.Headers = .init(), + body: Operations.OrgsCreateInvitation.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OrganizationInvitation) /// 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.ApiInsightsTimeStats { + public var json: Components.Schemas.OrganizationInvitation { get throws { switch self { case let .json(body): @@ -17399,33 +19617,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.OrgsCreateInvitation.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body) { + public init(body: Operations.OrgsCreateInvitation.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStatsByActor.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.OrgsCreateInvitation.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OrgsCreateInvitation.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/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 ) } @@ -17462,188 +19726,143 @@ public enum Operations { } } } - /// Get user stats + /// Cancel an organization invitation /// - /// Get API usage statistics within an organization for a user broken down by the type of access. + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. - public enum ApiInsightsGetUserStats { - public static let id: Swift.String = "api-insights/get-user-stats" + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// + /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. + public enum OrgsCancelInvitation { + public static let id: Swift.String = "orgs/cancel-invitation" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The ID of the user to query for stats + /// The unique identifier of the invitation. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. - public var userId: Components.Parameters.ApiInsightsUserId + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. + public var invitationId: Components.Parameters.InvitationId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - userId: The ID of the user to query for stats - public init( - org: Components.Parameters.Org, - userId: Components.Parameters.ApiInsightsUserId - ) { - self.org = org - self.userId = userId - } - } - public var path: Operations.ApiInsightsGetUserStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. - @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case subjectName = "subject_name" - case totalRequestCount = "total_request_count" - } - /// - Remark: Generated from `#/components/parameters/api-insights-sort`. - public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsSort? - /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/actor_name_substring`. - public var actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - actorNameSubstring: Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. - public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsSort? = nil, - actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? = nil + /// - invitationId: The unique identifier of the invitation. + public init( + org: Components.Parameters.Org, + invitationId: Components.Parameters.InvitationId ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.page = page - self.perPage = perPage - self.direction = direction - self.sort = sort - self.actorNameSubstring = actorNameSubstring + self.org = org + self.invitationId = invitationId } } - public var query: Operations.ApiInsightsGetUserStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. + public var path: Operations.OrgsCancelInvitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_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.ApiInsightsGetUserStats.Input.Headers + public var headers: Operations.OrgsCancelInvitation.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetUserStats.Input.Path, - query: Operations.ApiInsightsGetUserStats.Input.Query, - headers: Operations.ApiInsightsGetUserStats.Input.Headers = .init() + path: Operations.OrgsCancelInvitation.Input.Path, + headers: Operations.OrgsCancelInvitation.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsUserStats) - /// 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.ApiInsightsUserStats { - 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}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCancelInvitation.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/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.OrgsCancelInvitation.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.ApiInsightsGetUserStats.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetUserStats.Output.Ok.Body) { - self.body = body + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.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 + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetUserStats.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetUserStats.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -17680,44 +19899,48 @@ public enum Operations { } } } - /// List app installations for an organization - /// - /// Lists all GitHub Apps in an organization. The installation count includes - /// all GitHub Apps installed on repositories in the organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// List organization invitation teams /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/installations`. - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. - public enum OrgsListAppInstallations { - public static let id: Swift.String = "orgs/list-app-installations" + /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. + public enum OrgsListInvitationTeams { + public static let id: Swift.String = "orgs/list-invitation-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the invitation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. + public var invitationId: Components.Parameters.InvitationId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - invitationId: The unique identifier of the invitation. + public init( + org: Components.Parameters.Org, + invitationId: Components.Parameters.InvitationId + ) { self.org = org + self.invitationId = invitationId } } - public var path: Operations.OrgsListAppInstallations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query`. + public var path: Operations.OrgsListInvitationTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/per_page`. public var 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}/installations/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -17732,19 +19955,19 @@ public enum Operations { self.page = page } } - public var query: Operations.OrgsListAppInstallations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/header`. + public var query: Operations.OrgsListInvitationTeams.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListAppInstallations.Input.Headers + public var headers: Operations.OrgsListInvitationTeams.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -17752,9 +19975,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListAppInstallations.Input.Path, - query: Operations.OrgsListAppInstallations.Input.Query = .init(), - headers: Operations.OrgsListAppInstallations.Input.Headers = .init() + path: Operations.OrgsListInvitationTeams.Input.Path, + query: Operations.OrgsListInvitationTeams.Input.Query = .init(), + headers: Operations.OrgsListInvitationTeams.Input.Headers = .init() ) { self.path = path self.query = query @@ -17763,9 +19986,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -17776,39 +19999,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListAppInstallations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. + public var headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. - public var installations: [Components.Schemas.Installation] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - installations: - public init( - totalCount: Swift.Int, - installations: [Components.Schemas.Installation] - ) { - self.totalCount = totalCount - self.installations = installations - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case installations - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Team]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload { + public var json: [Components.Schemas.Team] { get throws { switch self { case let .json(body): @@ -17818,15 +20018,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListAppInstallations.Output.Ok.Body + public var body: Operations.OrgsListInvitationTeams.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(), - body: Operations.OrgsListAppInstallations.Output.Ok.Body + headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(), + body: Operations.OrgsListInvitationTeams.Output.Ok.Body ) { self.headers = headers self.body = body @@ -17834,15 +20034,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAppInstallations.Output.Ok) + case ok(Operations.OrgsListInvitationTeams.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.OrgsListAppInstallations.Output.Ok { + public var ok: Operations.OrgsListInvitationTeams.Output.Ok { get throws { switch self { case let .ok(response): @@ -17855,6 +20055,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.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. @@ -17886,23 +20109,20 @@ public enum Operations { } } } - /// List pending organization invitations + /// List issue fields for an organization /// - /// The return hash contains a `role` field which refers to the Organization - /// Invitation role and will be one of the following values: `direct_member`, `admin`, - /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub - /// member, the `login` field in the return hash will be `null`. + /// Lists all issue fields for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. - public enum OrgsListPendingInvitations { - public static let id: Swift.String = "orgs/list-pending-invitations" + /// - Remark: HTTP `GET /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)`. + public enum OrgsListIssueFields { + public static let id: Swift.String = "orgs/list-issue-fields" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -17912,112 +20132,43 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListPendingInvitations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/per_page`. - public var 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}/invitations/GET/query/page`. - public var page: Components.Parameters.Page? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case admin = "admin" - case directMember = "direct_member" - case billingManager = "billing_manager" - case hiringManager = "hiring_manager" - } - /// Filter invitations by their member role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - public var role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - @frozen public enum InvitationSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case member = "member" - case scim = "scim" - } - /// Filter invitations by their invitation source. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - public var invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? - /// 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)." - /// - role: Filter invitations by their member role. - /// - invitationSource: Filter invitations by their invitation source. - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? = nil, - invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? = nil - ) { - self.perPage = perPage - self.page = page - self.role = role - self.invitationSource = invitationSource - } - } - public var query: Operations.OrgsListPendingInvitations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/header`. + public var path: Operations.OrgsListIssueFields.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/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.OrgsListPendingInvitations.Input.Headers + public var headers: Operations.OrgsListIssueFields.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListPendingInvitations.Input.Path, - query: Operations.OrgsListPendingInvitations.Input.Query = .init(), - headers: Operations.OrgsListPendingInvitations.Input.Headers = .init() + path: Operations.OrgsListIssueFields.Input.Path, + headers: Operations.OrgsListIssueFields.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueField]) /// 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.OrganizationInvitation] { + public var json: [Components.Schemas.IssueField] { get throws { switch self { case let .json(body): @@ -18027,31 +20178,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListPendingInvitations.Output.Ok.Body + public var body: Operations.OrgsListIssueFields.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(), - body: Operations.OrgsListPendingInvitations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsListIssueFields.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPendingInvitations.Output.Ok) + case ok(Operations.OrgsListIssueFields.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.OrgsListPendingInvitations.Output.Ok { + public var ok: Operations.OrgsListIssueFields.Output.Ok { get throws { switch self { case let .ok(response): @@ -18066,7 +20212,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/get(orgs/list-issue-fields)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -18118,23 +20264,25 @@ public enum Operations { } } } - /// Create an organization invitation + /// Create issue field for an organization /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + /// Creates a new issue field for an organization. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). /// - /// - Remark: HTTP `POST /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. - public enum OrgsCreateInvitation { - public static let id: Swift.String = "orgs/create-invitation" + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)`. + public enum OrgsCreateIssueField { + public static let id: Swift.String = "orgs/create-issue-field" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -18144,85 +20292,25 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateInvitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/header`. + public var path: Operations.OrgsCreateIssueField.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/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.OrgsCreateInvitation.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + public var headers: Operations.OrgsCreateIssueField.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. - public var inviteeId: Swift.Int? - /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. - public var email: Swift.String? - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case admin = "admin" - case directMember = "direct_member" - case billingManager = "billing_manager" - case reinstate = "reinstate" - } - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - public var role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? - /// Specify IDs for the teams you want to invite new members to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. - public var teamIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - inviteeId: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - role: The role for the new member. - /// - teamIds: Specify IDs for the teams you want to invite new members to. - public init( - inviteeId: Swift.Int? = nil, - email: Swift.String? = nil, - role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? = nil, - teamIds: [Swift.Int]? = nil - ) { - self.inviteeId = inviteeId - self.email = email - self.role = role - self.teamIds = teamIds - } - public enum CodingKeys: String, CodingKey { - case inviteeId = "invitee_id" - case email - case role - case teamIds = "team_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. - case json(Operations.OrgsCreateInvitation.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/requestBody/content/application\/json`. + case json(Components.Schemas.OrganizationCreateIssueField) } - public var body: Operations.OrgsCreateInvitation.Input.Body? + public var body: Operations.OrgsCreateIssueField.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -18230,9 +20318,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateInvitation.Input.Path, - headers: Operations.OrgsCreateInvitation.Input.Headers = .init(), - body: Operations.OrgsCreateInvitation.Input.Body? = nil + path: Operations.OrgsCreateIssueField.Input.Path, + headers: Operations.OrgsCreateIssueField.Input.Headers = .init(), + body: Operations.OrgsCreateIssueField.Input.Body ) { self.path = path self.headers = headers @@ -18240,16 +20328,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. - case json(Components.Schemas.OrganizationInvitation) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/POST/responses/200/content/application\/json`. + case json(Components.Schemas.IssueField) /// 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.OrganizationInvitation { + public var json: Components.Schemas.IssueField { get throws { switch self { case let .json(body): @@ -18259,79 +20347,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateInvitation.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.OrgsCreateIssueField.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateInvitation.Output.Created.Body) { + public init(body: Operations.OrgsCreateIssueField.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.OrgsCreateInvitation.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCreateIssueField.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.OrgsCreateInvitation.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCreateIssueField.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/post(orgs/create-issue-field)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -18368,143 +20456,171 @@ public enum Operations { } } } - /// Cancel an organization invitation + /// Update issue field for an organization /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Updates an issue field for an organization. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. - public enum OrgsCancelInvitation { - public static let id: Swift.String = "orgs/cancel-invitation" + /// - Remark: HTTP `PATCH /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)`. + public enum OrgsUpdateIssueField { + public static let id: Swift.String = "orgs/update-issue-field" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the invitation. + /// The unique identifier of the issue field. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. - public var invitationId: Components.Parameters.InvitationId + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/path/issue_field_id`. + public var issueFieldId: Components.Parameters.IssueFieldId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitationId: The unique identifier of the invitation. + /// - issueFieldId: The unique identifier of the issue field. public init( org: Components.Parameters.Org, - invitationId: Components.Parameters.InvitationId + issueFieldId: Components.Parameters.IssueFieldId ) { self.org = org - self.invitationId = invitationId + self.issueFieldId = issueFieldId } } - public var path: Operations.OrgsCancelInvitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/header`. + public var path: Operations.OrgsUpdateIssueField.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_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.OrgsCancelInvitation.Input.Headers + public var headers: Operations.OrgsUpdateIssueField.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/requestBody/content/application\/json`. + case json(Components.Schemas.OrganizationUpdateIssueField) + } + public var body: Operations.OrgsUpdateIssueField.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsCancelInvitation.Input.Path, - headers: Operations.OrgsCancelInvitation.Input.Headers = .init() + path: Operations.OrgsUpdateIssueField.Input.Path, + headers: Operations.OrgsUpdateIssueField.Input.Headers = .init(), + body: Operations.OrgsUpdateIssueField.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.IssueField) + /// 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.IssueField { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdateIssueField.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdateIssueField.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCancelInvitation.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)/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.OrgsUpdateIssueField.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.OrgsCancelInvitation.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsUpdateIssueField.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/patch(orgs/update-issue-field)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -18541,157 +20657,96 @@ public enum Operations { } } } - /// List organization invitation teams + /// Delete issue field for an organization /// - /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + /// Deletes an issue field for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. - public enum OrgsListInvitationTeams { - public static let id: Swift.String = "orgs/list-invitation-teams" + /// You can find out more about issue fields in [Managing issue fields in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/using-issues/managing-issue-fields-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-fields/{issue_field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)`. + public enum OrgsDeleteIssueField { + public static let id: Swift.String = "orgs/delete-issue-field" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the invitation. + /// The unique identifier of the issue field. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. - public var invitationId: Components.Parameters.InvitationId + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_id}/DELETE/path/issue_field_id`. + public var issueFieldId: Components.Parameters.IssueFieldId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitationId: The unique identifier of the invitation. + /// - issueFieldId: The unique identifier of the issue field. public init( org: Components.Parameters.Org, - invitationId: Components.Parameters.InvitationId + issueFieldId: Components.Parameters.IssueFieldId ) { self.org = org - self.invitationId = invitationId - } - } - public var path: Operations.OrgsListInvitationTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/per_page`. - public var 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}/invitations/{invitation_id}/teams/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 + self.issueFieldId = issueFieldId } } - public var query: Operations.OrgsListInvitationTeams.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/header`. + public var path: Operations.OrgsDeleteIssueField.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-fields/{issue_field_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.OrgsListInvitationTeams.Input.Headers + public var headers: Operations.OrgsDeleteIssueField.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListInvitationTeams.Input.Path, - query: Operations.OrgsListInvitationTeams.Input.Query = .init(), - headers: Operations.OrgsListInvitationTeams.Input.Headers = .init() + path: Operations.OrgsDeleteIssueField.Input.Path, + headers: Operations.OrgsDeleteIssueField.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Team]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Team] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListInvitationTeams.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(), - body: Operations.OrgsListInvitationTeams.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response + /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListInvitationTeams.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListInvitationTeams.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)/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: Components.Responses.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -18699,7 +20754,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -18720,6 +20775,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/issue-fields/{issue_field_id}/delete(orgs/delete-issue-field)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22513,7 +24591,7 @@ public enum Operations { public struct JsonPayload: Codable, Hashable, Sendable { /// Creates a new `JsonPayload`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } From 5c8d5fcb7c3a44e66105a0ce1174fef8c873fd8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:12:23 +0000 Subject: [PATCH 17/33] Commit via running: make Sources/packages --- Sources/packages/Types.swift | 146 ++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 3 deletions(-) diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 17bd982923..4fb3d95047 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -1378,6 +1378,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -1388,6 +1489,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -1395,7 +1499,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -1404,6 +1511,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -1413,6 +1523,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -1555,6 +1668,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.NullableMinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/disabled`. @@ -1690,10 +1818,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -1771,6 +1899,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -1860,6 +1991,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.NullableMinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -1949,6 +2083,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2039,6 +2176,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 41013143b1830a99269738f0f5a1fa3295a8767f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:12:46 +0000 Subject: [PATCH 18/33] Commit via running: make Sources/pulls --- Sources/pulls/Types.swift | 65 +++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 6cdfe0b457..939bb274c2 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -1307,8 +1307,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1333,7 +1333,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1806,6 +1806,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2051,6 +2070,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2148,6 +2170,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2245,6 +2270,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2343,6 +2371,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2583,7 +2614,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -3536,7 +3567,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. public var email: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? + public var date: Foundation.Date? /// Creates a new `NullableGitUser`. /// /// - Parameters: @@ -3546,7 +3577,7 @@ public enum Components { public init( name: Swift.String? = nil, email: Swift.String? = nil, - date: Swift.String? = nil + date: Foundation.Date? = nil ) { self.name = name self.email = email @@ -3786,8 +3817,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/commit/author/case2`. case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -3806,7 +3837,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -3823,8 +3854,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -3843,7 +3874,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -4022,7 +4053,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/in_reply_to_id`. public var inReplyToId: Swift.Int? /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/user`. - public var user: Components.Schemas.SimpleUser + public var user: Components.Schemas.NullableSimpleUser? /// The text of the comment. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body`. @@ -4216,7 +4247,7 @@ public enum Components { commitId: Swift.String, originalCommitId: Swift.String, inReplyToId: Swift.Int? = nil, - user: Components.Schemas.SimpleUser, + user: Components.Schemas.NullableSimpleUser? = nil, body: Swift.String, createdAt: Foundation.Date, updatedAt: Foundation.Date, @@ -9557,8 +9588,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -9579,7 +9610,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } From 8a212090138bbaa89784dc49735a76c816442f24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:13:30 +0000 Subject: [PATCH 19/33] Commit via running: make Sources/reactions --- Sources/reactions/Client.swift | 1401 +++--------- Sources/reactions/Types.swift | 3863 +++++++------------------------- 2 files changed, 1033 insertions(+), 4231 deletions(-) diff --git a/Sources/reactions/Client.swift b/Sources/reactions/Client.swift index 292c822cef..a5f4db0bfc 100644 --- a/Sources/reactions/Client.swift +++ b/Sources/reactions/Client.swift @@ -38,29 +38,23 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// List reactions for a team discussion comment - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + /// List reactions for a commit comment /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-in-org)`. - public func reactionsListForTeamDiscussionCommentInOrg(_ input: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input) async throws -> Operations.ReactionsListForTeamDiscussionCommentInOrg.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)`. + public func reactionsListForCommitComment(_ input: Operations.ReactionsListForCommitComment.Input) async throws -> Operations.ReactionsListForCommitComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsListForTeamDiscussionCommentInOrg.id, + forOperation: Operations.ReactionsListForCommitComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", + template: "/repos/{}/{}/comments/{}/reactions", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber + input.path.owner, + input.path.repo, + input.path.commentId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -98,13 +92,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ReactionsListForCommitComment.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.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Body + let body: Operations.ReactionsListForCommitComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -127,6 +121,28 @@ public struct Client: APIProtocol { headers: headers, body: body )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -139,31 +155,23 @@ public struct Client: APIProtocol { } ) } - /// Create reaction for a team discussion comment - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + /// Create reaction for a commit comment /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)`. - public func reactionsCreateForTeamDiscussionCommentInOrg(_ input: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)`. + public func reactionsCreateForCommitComment(_ input: Operations.ReactionsCreateForCommitComment.Input) async throws -> Operations.ReactionsCreateForCommitComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.id, + forOperation: Operations.ReactionsCreateForCommitComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", + template: "/repos/{}/{}/comments/{}/reactions", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber + input.path.owner, + input.path.repo, + input.path.commentId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -190,7 +198,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Ok.Body + let body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -212,7 +220,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Created.Body + let body: Operations.ReactionsCreateForCommitComment.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -232,6 +240,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .created(.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, @@ -244,29 +274,26 @@ public struct Client: APIProtocol { } ) } - /// Delete team discussion comment reaction + /// Delete a commit comment reaction /// /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)`. - public func reactionsDeleteForTeamDiscussionComment(_ input: Operations.ReactionsDeleteForTeamDiscussionComment.Input) async throws -> Operations.ReactionsDeleteForTeamDiscussionComment.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)`. + public func reactionsDeleteForCommitComment(_ input: Operations.ReactionsDeleteForCommitComment.Input) async throws -> Operations.ReactionsDeleteForCommitComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsDeleteForTeamDiscussionComment.id, + forOperation: Operations.ReactionsDeleteForCommitComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions/{}", + template: "/repos/{}/{}/comments/{}/reactions/{}", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber, + input.path.owner, + input.path.repo, + input.path.commentId, input.path.reactionId ] ) @@ -293,28 +320,23 @@ public struct Client: APIProtocol { } ) } - /// List reactions for a team discussion - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + /// List reactions for an issue comment /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-in-org)`. - public func reactionsListForTeamDiscussionInOrg(_ input: Operations.ReactionsListForTeamDiscussionInOrg.Input) async throws -> Operations.ReactionsListForTeamDiscussionInOrg.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)`. + public func reactionsListForIssueComment(_ input: Operations.ReactionsListForIssueComment.Input) async throws -> Operations.ReactionsListForIssueComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsListForTeamDiscussionInOrg.id, + forOperation: Operations.ReactionsListForIssueComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/reactions", + template: "/repos/{}/{}/issues/comments/{}/reactions", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber + input.path.owner, + input.path.repo, + input.path.commentId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -352,13 +374,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ReactionsListForIssueComment.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.ReactionsListForTeamDiscussionInOrg.Output.Ok.Body + let body: Operations.ReactionsListForIssueComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -381,6 +403,28 @@ public struct Client: APIProtocol { headers: headers, body: body )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -393,30 +437,23 @@ public struct Client: APIProtocol { } ) } - /// Create reaction for a team discussion - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + /// Create reaction for an issue comment /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)`. - public func reactionsCreateForTeamDiscussionInOrg(_ input: Operations.ReactionsCreateForTeamDiscussionInOrg.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionInOrg.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)`. + public func reactionsCreateForIssueComment(_ input: Operations.ReactionsCreateForIssueComment.Input) async throws -> Operations.ReactionsCreateForIssueComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsCreateForTeamDiscussionInOrg.id, + forOperation: Operations.ReactionsCreateForIssueComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/reactions", + template: "/repos/{}/{}/issues/comments/{}/reactions", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber + input.path.owner, + input.path.repo, + input.path.commentId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -443,7 +480,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Ok.Body + let body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -465,7 +502,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Created.Body + let body: Operations.ReactionsCreateForIssueComment.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -485,6 +522,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .created(.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, @@ -497,28 +556,26 @@ public struct Client: APIProtocol { } ) } - /// Delete team discussion reaction + /// Delete an issue comment reaction /// /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). + /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)`. - public func reactionsDeleteForTeamDiscussion(_ input: Operations.ReactionsDeleteForTeamDiscussion.Input) async throws -> Operations.ReactionsDeleteForTeamDiscussion.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)`. + public func reactionsDeleteForIssueComment(_ input: Operations.ReactionsDeleteForIssueComment.Input) async throws -> Operations.ReactionsDeleteForIssueComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsDeleteForTeamDiscussion.id, + forOperation: Operations.ReactionsDeleteForIssueComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/reactions/{}", + template: "/repos/{}/{}/issues/comments/{}/reactions/{}", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber, + input.path.owner, + input.path.repo, + input.path.commentId, input.path.reactionId ] ) @@ -545,23 +602,23 @@ public struct Client: APIProtocol { } ) } - /// List reactions for a commit comment + /// List reactions for an issue /// - /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). + /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)`. - public func reactionsListForCommitComment(_ input: Operations.ReactionsListForCommitComment.Input) async throws -> Operations.ReactionsListForCommitComment.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)`. + public func reactionsListForIssue(_ input: Operations.ReactionsListForIssue.Input) async throws -> Operations.ReactionsListForIssue.Output { try await client.send( input: input, - forOperation: Operations.ReactionsListForCommitComment.id, + forOperation: Operations.ReactionsListForIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/comments/{}/reactions", + template: "/repos/{}/{}/issues/{}/reactions", parameters: [ input.path.owner, input.path.repo, - input.path.commentId + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -599,13 +656,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ReactionsListForCommitComment.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ReactionsListForIssue.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.ReactionsListForCommitComment.Output.Ok.Body + let body: Operations.ReactionsListForIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -650,6 +707,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -662,23 +741,23 @@ public struct Client: APIProtocol { } ) } - /// Create reaction for a commit comment + /// Create reaction for an issue /// - /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. + /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)`. - public func reactionsCreateForCommitComment(_ input: Operations.ReactionsCreateForCommitComment.Input) async throws -> Operations.ReactionsCreateForCommitComment.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)`. + public func reactionsCreateForIssue(_ input: Operations.ReactionsCreateForIssue.Input) async throws -> Operations.ReactionsCreateForIssue.Output { try await client.send( input: input, - forOperation: Operations.ReactionsCreateForCommitComment.id, + forOperation: Operations.ReactionsCreateForIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/comments/{}/reactions", + template: "/repos/{}/{}/issues/{}/reactions", parameters: [ input.path.owner, input.path.repo, - input.path.commentId + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -705,7 +784,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body + let body: Operations.ReactionsCreateForIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -727,7 +806,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForCommitComment.Output.Created.Body + let body: Operations.ReactionsCreateForIssue.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -781,26 +860,26 @@ public struct Client: APIProtocol { } ) } - /// Delete a commit comment reaction + /// Delete an issue reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. /// - /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). + /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)`. - public func reactionsDeleteForCommitComment(_ input: Operations.ReactionsDeleteForCommitComment.Input) async throws -> Operations.ReactionsDeleteForCommitComment.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)`. + public func reactionsDeleteForIssue(_ input: Operations.ReactionsDeleteForIssue.Input) async throws -> Operations.ReactionsDeleteForIssue.Output { try await client.send( input: input, - forOperation: Operations.ReactionsDeleteForCommitComment.id, + forOperation: Operations.ReactionsDeleteForIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/comments/{}/reactions/{}", + template: "/repos/{}/{}/issues/{}/reactions/{}", parameters: [ input.path.owner, input.path.repo, - input.path.commentId, + input.path.issueNumber, input.path.reactionId ] ) @@ -827,19 +906,19 @@ public struct Client: APIProtocol { } ) } - /// List reactions for an issue comment + /// List reactions for a pull request review comment /// - /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). + /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)`. - public func reactionsListForIssueComment(_ input: Operations.ReactionsListForIssueComment.Input) async throws -> Operations.ReactionsListForIssueComment.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)`. + public func reactionsListForPullRequestReviewComment(_ input: Operations.ReactionsListForPullRequestReviewComment.Input) async throws -> Operations.ReactionsListForPullRequestReviewComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsListForIssueComment.id, + forOperation: Operations.ReactionsListForPullRequestReviewComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/comments/{}/reactions", + template: "/repos/{}/{}/pulls/comments/{}/reactions", parameters: [ input.path.owner, input.path.repo, @@ -881,13 +960,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ReactionsListForIssueComment.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ReactionsListForPullRequestReviewComment.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.ReactionsListForIssueComment.Output.Ok.Body + let body: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -944,19 +1023,19 @@ public struct Client: APIProtocol { } ) } - /// Create reaction for an issue comment + /// Create reaction for a pull request review comment /// - /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. + /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)`. - public func reactionsCreateForIssueComment(_ input: Operations.ReactionsCreateForIssueComment.Input) async throws -> Operations.ReactionsCreateForIssueComment.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)`. + public func reactionsCreateForPullRequestReviewComment(_ input: Operations.ReactionsCreateForPullRequestReviewComment.Input) async throws -> Operations.ReactionsCreateForPullRequestReviewComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsCreateForIssueComment.id, + forOperation: Operations.ReactionsCreateForPullRequestReviewComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/comments/{}/reactions", + template: "/repos/{}/{}/pulls/comments/{}/reactions", parameters: [ input.path.owner, input.path.repo, @@ -987,7 +1066,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body + let body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1009,7 +1088,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForIssueComment.Output.Created.Body + let body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1063,22 +1142,22 @@ public struct Client: APIProtocol { } ) } - /// Delete an issue comment reaction + /// Delete a pull request comment reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` /// - /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). + /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)`. - public func reactionsDeleteForIssueComment(_ input: Operations.ReactionsDeleteForIssueComment.Input) async throws -> Operations.ReactionsDeleteForIssueComment.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)`. + public func reactionsDeleteForPullRequestComment(_ input: Operations.ReactionsDeleteForPullRequestComment.Input) async throws -> Operations.ReactionsDeleteForPullRequestComment.Output { try await client.send( input: input, - forOperation: Operations.ReactionsDeleteForIssueComment.id, + forOperation: Operations.ReactionsDeleteForPullRequestComment.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/comments/{}/reactions/{}", + template: "/repos/{}/{}/pulls/comments/{}/reactions/{}", parameters: [ input.path.owner, input.path.repo, @@ -1109,23 +1188,23 @@ public struct Client: APIProtocol { } ) } - /// List reactions for an issue + /// List reactions for a release /// - /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). + /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)`. - public func reactionsListForIssue(_ input: Operations.ReactionsListForIssue.Input) async throws -> Operations.ReactionsListForIssue.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/{release_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)`. + public func reactionsListForRelease(_ input: Operations.ReactionsListForRelease.Input) async throws -> Operations.ReactionsListForRelease.Output { try await client.send( input: input, - forOperation: Operations.ReactionsListForIssue.id, + forOperation: Operations.ReactionsListForRelease.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/reactions", + template: "/repos/{}/{}/releases/{}/reactions", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber + input.path.releaseId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1163,13 +1242,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ReactionsListForIssue.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ReactionsListForRelease.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.ReactionsListForIssue.Output.Ok.Body + let body: Operations.ReactionsListForRelease.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1214,28 +1293,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1248,23 +1305,23 @@ public struct Client: APIProtocol { } ) } - /// Create reaction for an issue + /// Create reaction for a release /// - /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. + /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)`. - public func reactionsCreateForIssue(_ input: Operations.ReactionsCreateForIssue.Input) async throws -> Operations.ReactionsCreateForIssue.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases/{release_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)`. + public func reactionsCreateForRelease(_ input: Operations.ReactionsCreateForRelease.Input) async throws -> Operations.ReactionsCreateForRelease.Output { try await client.send( input: input, - forOperation: Operations.ReactionsCreateForIssue.id, + forOperation: Operations.ReactionsCreateForRelease.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/reactions", + template: "/repos/{}/{}/releases/{}/reactions", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber + input.path.releaseId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1291,7 +1348,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForIssue.Output.Ok.Body + let body: Operations.ReactionsCreateForRelease.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1313,7 +1370,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForIssue.Output.Created.Body + let body: Operations.ReactionsCreateForRelease.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1367,26 +1424,26 @@ public struct Client: APIProtocol { } ) } - /// Delete an issue reaction + /// Delete a release reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`. /// - /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). + /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)`. - public func reactionsDeleteForIssue(_ input: Operations.ReactionsDeleteForIssue.Input) async throws -> Operations.ReactionsDeleteForIssue.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)`. + public func reactionsDeleteForRelease(_ input: Operations.ReactionsDeleteForRelease.Input) async throws -> Operations.ReactionsDeleteForRelease.Output { try await client.send( input: input, - forOperation: Operations.ReactionsDeleteForIssue.id, + forOperation: Operations.ReactionsDeleteForRelease.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/reactions/{}", + template: "/repos/{}/{}/releases/{}/reactions/{}", parameters: [ input.path.owner, input.path.repo, - input.path.issueNumber, + input.path.releaseId, input.path.reactionId ] ) @@ -1413,934 +1470,4 @@ public struct Client: APIProtocol { } ) } - /// List reactions for a pull request review comment - /// - /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)`. - public func reactionsListForPullRequestReviewComment(_ input: Operations.ReactionsListForPullRequestReviewComment.Input) async throws -> Operations.ReactionsListForPullRequestReviewComment.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsListForPullRequestReviewComment.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/pulls/comments/{}/reactions", - parameters: [ - input.path.owner, - input.path.repo, - input.path.commentId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "content", - value: input.query.content - ) - 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.ReactionsListForPullRequestReviewComment.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.ReactionsListForPullRequestReviewComment.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.Reaction].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create reaction for a pull request review comment - /// - /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)`. - public func reactionsCreateForPullRequestReviewComment(_ input: Operations.ReactionsCreateForPullRequestReviewComment.Input) async throws -> Operations.ReactionsCreateForPullRequestReviewComment.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsCreateForPullRequestReviewComment.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/pulls/comments/{}/reactions", - parameters: [ - input.path.owner, - input.path.repo, - input.path.commentId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForPullRequestReviewComment.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForPullRequestReviewComment.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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 - ) - ) - } - } - ) - } - /// Delete a pull request comment reaction - /// - /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` - /// - /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)`. - public func reactionsDeleteForPullRequestComment(_ input: Operations.ReactionsDeleteForPullRequestComment.Input) async throws -> Operations.ReactionsDeleteForPullRequestComment.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsDeleteForPullRequestComment.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/pulls/comments/{}/reactions/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.commentId, - input.path.reactionId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List reactions for a release - /// - /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/{release_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)`. - public func reactionsListForRelease(_ input: Operations.ReactionsListForRelease.Input) async throws -> Operations.ReactionsListForRelease.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsListForRelease.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/releases/{}/reactions", - parameters: [ - input.path.owner, - input.path.repo, - input.path.releaseId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "content", - value: input.query.content - ) - 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.ReactionsListForRelease.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.ReactionsListForRelease.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.Reaction].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create reaction for a release - /// - /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases/{release_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)`. - public func reactionsCreateForRelease(_ input: Operations.ReactionsCreateForRelease.Input) async throws -> Operations.ReactionsCreateForRelease.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsCreateForRelease.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/releases/{}/reactions", - parameters: [ - input.path.owner, - input.path.repo, - input.path.releaseId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForRelease.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForRelease.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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 - ) - ) - } - } - ) - } - /// Delete a release reaction - /// - /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`. - /// - /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)`. - public func reactionsDeleteForRelease(_ input: Operations.ReactionsDeleteForRelease.Input) async throws -> Operations.ReactionsDeleteForRelease.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsDeleteForRelease.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/releases/{}/reactions/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.releaseId, - input.path.reactionId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List reactions for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - public func reactionsListForTeamDiscussionCommentLegacy(_ input: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input) async throws -> Operations.ReactionsListForTeamDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsListForTeamDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments/{}/reactions", - parameters: [ - input.path.teamId, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "content", - value: input.query.content - ) - 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.ReactionsListForTeamDiscussionCommentLegacy.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.ReactionsListForTeamDiscussionCommentLegacy.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.Reaction].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create reaction for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - public func reactionsCreateForTeamDiscussionCommentLegacy(_ input: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments/{}/reactions", - parameters: [ - input.path.teamId, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List reactions for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-legacy)`. - @available(*, deprecated) - public func reactionsListForTeamDiscussionLegacy(_ input: Operations.ReactionsListForTeamDiscussionLegacy.Input) async throws -> Operations.ReactionsListForTeamDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsListForTeamDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/reactions", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "content", - value: input.query.content - ) - 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.ReactionsListForTeamDiscussionLegacy.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.ReactionsListForTeamDiscussionLegacy.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.Reaction].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create reaction for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-legacy)`. - @available(*, deprecated) - public func reactionsCreateForTeamDiscussionLegacy(_ input: Operations.ReactionsCreateForTeamDiscussionLegacy.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.ReactionsCreateForTeamDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/reactions", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReactionsCreateForTeamDiscussionLegacy.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.Reaction.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } } diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index a63807c418..69d81a81e6 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -11,82 +11,6 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// List reactions for a team discussion comment - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-in-org)`. - func reactionsListForTeamDiscussionCommentInOrg(_ input: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input) async throws -> Operations.ReactionsListForTeamDiscussionCommentInOrg.Output - /// Create reaction for a team discussion comment - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)`. - func reactionsCreateForTeamDiscussionCommentInOrg(_ input: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output - /// Delete team discussion comment reaction - /// - /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)`. - func reactionsDeleteForTeamDiscussionComment(_ input: Operations.ReactionsDeleteForTeamDiscussionComment.Input) async throws -> Operations.ReactionsDeleteForTeamDiscussionComment.Output - /// List reactions for a team discussion - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-in-org)`. - func reactionsListForTeamDiscussionInOrg(_ input: Operations.ReactionsListForTeamDiscussionInOrg.Input) async throws -> Operations.ReactionsListForTeamDiscussionInOrg.Output - /// Create reaction for a team discussion - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)`. - func reactionsCreateForTeamDiscussionInOrg(_ input: Operations.ReactionsCreateForTeamDiscussionInOrg.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionInOrg.Output - /// Delete team discussion reaction - /// - /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)`. - func reactionsDeleteForTeamDiscussion(_ input: Operations.ReactionsDeleteForTeamDiscussion.Input) async throws -> Operations.ReactionsDeleteForTeamDiscussion.Output /// List reactions for a commit comment /// /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). @@ -207,186 +131,10 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)`. func reactionsDeleteForRelease(_ input: Operations.ReactionsDeleteForRelease.Input) async throws -> Operations.ReactionsDeleteForRelease.Output - /// List reactions for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - func reactionsListForTeamDiscussionCommentLegacy(_ input: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input) async throws -> Operations.ReactionsListForTeamDiscussionCommentLegacy.Output - /// Create reaction for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - func reactionsCreateForTeamDiscussionCommentLegacy(_ input: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output - /// List reactions for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-legacy)`. - @available(*, deprecated) - func reactionsListForTeamDiscussionLegacy(_ input: Operations.ReactionsListForTeamDiscussionLegacy.Input) async throws -> Operations.ReactionsListForTeamDiscussionLegacy.Output - /// Create reaction for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-legacy)`. - @available(*, deprecated) - func reactionsCreateForTeamDiscussionLegacy(_ input: Operations.ReactionsCreateForTeamDiscussionLegacy.Input) async throws -> Operations.ReactionsCreateForTeamDiscussionLegacy.Output } /// Convenience overloads for operation inputs. extension APIProtocol { - /// List reactions for a team discussion comment - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-in-org)`. - public func reactionsListForTeamDiscussionCommentInOrg( - path: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Path, - query: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Headers = .init() - ) async throws -> Operations.ReactionsListForTeamDiscussionCommentInOrg.Output { - try await reactionsListForTeamDiscussionCommentInOrg(Operations.ReactionsListForTeamDiscussionCommentInOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create reaction for a team discussion comment - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)`. - public func reactionsCreateForTeamDiscussionCommentInOrg( - path: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body - ) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output { - try await reactionsCreateForTeamDiscussionCommentInOrg(Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete team discussion comment reaction - /// - /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)`. - public func reactionsDeleteForTeamDiscussionComment(path: Operations.ReactionsDeleteForTeamDiscussionComment.Input.Path) async throws -> Operations.ReactionsDeleteForTeamDiscussionComment.Output { - try await reactionsDeleteForTeamDiscussionComment(Operations.ReactionsDeleteForTeamDiscussionComment.Input(path: path)) - } - /// List reactions for a team discussion - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-in-org)`. - public func reactionsListForTeamDiscussionInOrg( - path: Operations.ReactionsListForTeamDiscussionInOrg.Input.Path, - query: Operations.ReactionsListForTeamDiscussionInOrg.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionInOrg.Input.Headers = .init() - ) async throws -> Operations.ReactionsListForTeamDiscussionInOrg.Output { - try await reactionsListForTeamDiscussionInOrg(Operations.ReactionsListForTeamDiscussionInOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create reaction for a team discussion - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)`. - public func reactionsCreateForTeamDiscussionInOrg( - path: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body - ) async throws -> Operations.ReactionsCreateForTeamDiscussionInOrg.Output { - try await reactionsCreateForTeamDiscussionInOrg(Operations.ReactionsCreateForTeamDiscussionInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete team discussion reaction - /// - /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)`. - public func reactionsDeleteForTeamDiscussion(path: Operations.ReactionsDeleteForTeamDiscussion.Input.Path) async throws -> Operations.ReactionsDeleteForTeamDiscussion.Output { - try await reactionsDeleteForTeamDiscussion(Operations.ReactionsDeleteForTeamDiscussion.Input(path: path)) - } /// List reactions for a commit comment /// /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). @@ -617,102 +365,6 @@ extension APIProtocol { public func reactionsDeleteForRelease(path: Operations.ReactionsDeleteForRelease.Input.Path) async throws -> Operations.ReactionsDeleteForRelease.Output { try await reactionsDeleteForRelease(Operations.ReactionsDeleteForRelease.Input(path: path)) } - /// List reactions for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - public func reactionsListForTeamDiscussionCommentLegacy( - path: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Path, - query: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Headers = .init() - ) async throws -> Operations.ReactionsListForTeamDiscussionCommentLegacy.Output { - try await reactionsListForTeamDiscussionCommentLegacy(Operations.ReactionsListForTeamDiscussionCommentLegacy.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create reaction for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-legacy)`. - @available(*, deprecated) - public func reactionsCreateForTeamDiscussionCommentLegacy( - path: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Body - ) async throws -> Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output { - try await reactionsCreateForTeamDiscussionCommentLegacy(Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// List reactions for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-legacy)`. - @available(*, deprecated) - public func reactionsListForTeamDiscussionLegacy( - path: Operations.ReactionsListForTeamDiscussionLegacy.Input.Path, - query: Operations.ReactionsListForTeamDiscussionLegacy.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionLegacy.Input.Headers = .init() - ) async throws -> Operations.ReactionsListForTeamDiscussionLegacy.Output { - try await reactionsListForTeamDiscussionLegacy(Operations.ReactionsListForTeamDiscussionLegacy.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create reaction for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-legacy)`. - @available(*, deprecated) - public func reactionsCreateForTeamDiscussionLegacy( - path: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Body - ) async throws -> Operations.ReactionsCreateForTeamDiscussionLegacy.Output { - try await reactionsCreateForTeamDiscussionLegacy(Operations.ReactionsCreateForTeamDiscussionLegacy.Input( - path: path, - headers: headers, - body: body - )) - } } /// Server URLs defined in the OpenAPI document. @@ -803,8 +455,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -829,7 +481,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1114,14 +766,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -1134,14 +778,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/components/parameters/discussion-number`. - public typealias DiscussionNumber = Swift.Int - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/components/parameters/comment-number`. - public typealias CommentNumber = Swift.Int /// The unique identifier of the reaction. /// /// - Remark: Generated from `#/components/parameters/reaction-id`. @@ -1154,10 +790,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/release-id`. public typealias ReleaseId = Swift.Int - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/components/parameters/team-id`. - public typealias TeamId = Swift.Int } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -1257,61 +889,49 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// List reactions for a team discussion comment - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + /// List reactions for a commit comment /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-in-org)`. - public enum ReactionsListForTeamDiscussionCommentInOrg { - public static let id: Swift.String = "reactions/list-for-team-discussion-comment-in-org" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)`. + public enum ReactionsListForCommitComment { + public static let id: Swift.String = "reactions/list-for-commit-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber + self.owner = owner + self.repo = repo + self.commentId = commentId } } - public var path: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query`. + public var path: Operations.ReactionsListForCommitComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -1322,26 +942,26 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Query.ContentPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/content`. + public var content: Operations.ReactionsListForCommitComment.Input.Query.ContentPayload? /// 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}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/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}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. /// - 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( - content: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Query.ContentPayload? = nil, + content: Operations.ReactionsListForCommitComment.Input.Query.ContentPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { @@ -1350,19 +970,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/header`. + public var query: Operations.ReactionsListForCommitComment.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/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.ReactionsListForTeamDiscussionCommentInOrg.Input.Headers + public var headers: Operations.ReactionsListForCommitComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -1370,9 +990,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Path, - query: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionCommentInOrg.Input.Headers = .init() + path: Operations.ReactionsListForCommitComment.Input.Path, + query: Operations.ReactionsListForCommitComment.Input.Query = .init(), + headers: Operations.ReactionsListForCommitComment.Input.Headers = .init() ) { self.path = path self.query = query @@ -1381,9 +1001,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -1394,10 +1014,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/content`. + public var headers: Operations.ReactionsListForCommitComment.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. case json([Components.Schemas.Reaction]) /// The associated value of the enum case if `self` is `.json`. /// @@ -1413,15 +1033,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Body + public var body: Operations.ReactionsListForCommitComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok.Body + headers: Operations.ReactionsListForCommitComment.Output.Ok.Headers = .init(), + body: Operations.ReactionsListForCommitComment.Output.Ok.Body ) { self.headers = headers self.body = body @@ -1429,15 +1049,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok) + case ok(Operations.ReactionsListForCommitComment.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.ReactionsListForTeamDiscussionCommentInOrg.Output.Ok { + public var ok: Operations.ReactionsListForCommitComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -1450,6 +1070,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)/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. @@ -1481,79 +1124,65 @@ public enum Operations { } } } - /// Create reaction for a team discussion comment - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + /// Create reaction for a commit comment /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)`. - public enum ReactionsCreateForTeamDiscussionCommentInOrg { - public static let id: Swift.String = "reactions/create-for-team-discussion-comment-in-org" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)`. + public enum ReactionsCreateForCommitComment { + public static let id: Swift.String = "reactions/create-for-commit-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } + self.owner = owner + self.repo = repo + self.commentId = commentId + } } - public var path: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/header`. + public var path: Operations.ReactionsCreateForCommitComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/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.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody`. + public var headers: Operations.ReactionsCreateForCommitComment.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -1564,25 +1193,25 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body.JsonPayload.ContentPayload + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json/content`. + public var content: Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload.ContentPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. - public init(content: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body.JsonPayload.ContentPayload) { + /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. + public init(content: Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload.ContentPayload) { self.content = content } public enum CodingKeys: String, CodingKey { case content } } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. + case json(Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload) } - public var body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body + public var body: Operations.ReactionsCreateForCommitComment.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -1590,9 +1219,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Input.Body + path: Operations.ReactionsCreateForCommitComment.Input.Path, + headers: Operations.ReactionsCreateForCommitComment.Input.Headers = .init(), + body: Operations.ReactionsCreateForCommitComment.Input.Body ) { self.path = path self.headers = headers @@ -1601,9 +1230,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -1619,26 +1248,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Ok.Body + public var body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Ok.Body) { + public init(body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body) { self.body = body } } - /// Response when the reaction type has already been added to this team discussion comment + /// Reaction exists /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Ok) + case ok(Operations.ReactionsCreateForCommitComment.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.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Ok { + public var ok: Operations.ReactionsCreateForCommitComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -1652,9 +1281,9 @@ public enum Operations { } } public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/201/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -1670,26 +1299,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Created.Body + public var body: Operations.ReactionsCreateForCommitComment.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Created.Body) { + public init(body: Operations.ReactionsCreateForCommitComment.Output.Created.Body) { self.body = body } } - /// Response + /// Reaction created /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-in-org)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Created) + case created(Operations.ReactionsCreateForCommitComment.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForTeamDiscussionCommentInOrg.Output.Created { + public var created: Operations.ReactionsCreateForCommitComment.Output.Created { get throws { switch self { case let .created(response): @@ -1702,6 +1331,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/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. @@ -1733,70 +1385,61 @@ public enum Operations { } } } - /// Delete team discussion comment reaction + /// Delete a commit comment reaction /// /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)`. - public enum ReactionsDeleteForTeamDiscussionComment { - public static let id: Swift.String = "reactions/delete-for-team-discussion-comment" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)`. + public enum ReactionsDeleteForCommitComment { + public static let id: Swift.String = "reactions/delete-for-commit-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// The unique identifier of the reaction. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/DELETE/path/reaction_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. public var reactionId: Components.Parameters.ReactionId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. /// - reactionId: The unique identifier of the reaction. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber, + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId, reactionId: Components.Parameters.ReactionId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber + self.owner = owner + self.repo = repo + self.commentId = commentId self.reactionId = reactionId } } - public var path: Operations.ReactionsDeleteForTeamDiscussionComment.Input.Path + public var path: Operations.ReactionsDeleteForCommitComment.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReactionsDeleteForTeamDiscussionComment.Input.Path) { + public init(path: Operations.ReactionsDeleteForCommitComment.Input.Path) { self.path = path } } @@ -1807,13 +1450,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForTeamDiscussionComment.Output.NoContent) + case noContent(Operations.ReactionsDeleteForCommitComment.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -1823,7 +1466,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReactionsDeleteForTeamDiscussionComment.Output.NoContent { + public var noContent: Operations.ReactionsDeleteForCommitComment.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -1842,54 +1485,49 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List reactions for a team discussion - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + /// List reactions for an issue comment /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-in-org)`. - public enum ReactionsListForTeamDiscussionInOrg { - public static let id: Swift.String = "reactions/list-for-team-discussion-in-org" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)`. + public enum ReactionsListForIssueComment { + public static let id: Swift.String = "reactions/list-for-issue-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.owner = owner + self.repo = repo + self.commentId = commentId } } - public var path: Operations.ReactionsListForTeamDiscussionInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/query`. + public var path: Operations.ReactionsListForIssueComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/query/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -1900,26 +1538,26 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForTeamDiscussionInOrg.Input.Query.ContentPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/content`. + public var content: Operations.ReactionsListForIssueComment.Input.Query.ContentPayload? /// 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}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/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}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. /// - 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( - content: Operations.ReactionsListForTeamDiscussionInOrg.Input.Query.ContentPayload? = nil, + content: Operations.ReactionsListForIssueComment.Input.Query.ContentPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { @@ -1928,19 +1566,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ReactionsListForTeamDiscussionInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/header`. + public var query: Operations.ReactionsListForIssueComment.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/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.ReactionsListForTeamDiscussionInOrg.Input.Headers + public var headers: Operations.ReactionsListForIssueComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -1948,9 +1586,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ReactionsListForTeamDiscussionInOrg.Input.Path, - query: Operations.ReactionsListForTeamDiscussionInOrg.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionInOrg.Input.Headers = .init() + path: Operations.ReactionsListForIssueComment.Input.Path, + query: Operations.ReactionsListForIssueComment.Input.Query = .init(), + headers: Operations.ReactionsListForIssueComment.Input.Headers = .init() ) { self.path = path self.query = query @@ -1959,9 +1597,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -1972,10 +1610,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/responses/200/content`. + public var headers: Operations.ReactionsListForIssueComment.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. case json([Components.Schemas.Reaction]) /// The associated value of the enum case if `self` is `.json`. /// @@ -1991,15 +1629,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok.Body + public var body: Operations.ReactionsListForIssueComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok.Body + headers: Operations.ReactionsListForIssueComment.Output.Ok.Headers = .init(), + body: Operations.ReactionsListForIssueComment.Output.Ok.Body ) { self.headers = headers self.body = body @@ -2007,15 +1645,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForTeamDiscussionInOrg.Output.Ok) + case ok(Operations.ReactionsListForIssueComment.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.ReactionsListForTeamDiscussionInOrg.Output.Ok { + public var ok: Operations.ReactionsListForIssueComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -2028,6 +1666,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)/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. @@ -2059,72 +1720,65 @@ public enum Operations { } } } - /// Create reaction for a team discussion - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + /// Create reaction for an issue comment /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)`. - public enum ReactionsCreateForTeamDiscussionInOrg { - public static let id: Swift.String = "reactions/create-for-team-discussion-in-org" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)`. + public enum ReactionsCreateForIssueComment { + public static let id: Swift.String = "reactions/create-for-issue-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.owner = owner + self.repo = repo + self.commentId = commentId } } - public var path: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/header`. + public var path: Operations.ReactionsCreateForIssueComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/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.ReactionsCreateForTeamDiscussionInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/requestBody`. + public var headers: Operations.ReactionsCreateForIssueComment.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/requestBody/json/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -2135,25 +1789,25 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body.JsonPayload.ContentPayload + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json/content`. + public var content: Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload.ContentPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. - public init(content: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body.JsonPayload.ContentPayload) { + /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. + public init(content: Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload.ContentPayload) { self.content = content } public enum CodingKeys: String, CodingKey { case content } } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. + case json(Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload) } - public var body: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body + public var body: Operations.ReactionsCreateForIssueComment.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -2161,9 +1815,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionInOrg.Input.Body + path: Operations.ReactionsCreateForIssueComment.Input.Path, + headers: Operations.ReactionsCreateForIssueComment.Input.Headers = .init(), + body: Operations.ReactionsCreateForIssueComment.Input.Body ) { self.path = path self.headers = headers @@ -2172,9 +1826,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -2190,26 +1844,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Ok.Body + public var body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Ok.Body) { + public init(body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body) { self.body = body } } - /// Response + /// Reaction exists /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Ok) + case ok(Operations.ReactionsCreateForIssueComment.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.ReactionsCreateForTeamDiscussionInOrg.Output.Ok { + public var ok: Operations.ReactionsCreateForIssueComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -2223,9 +1877,9 @@ public enum Operations { } } public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/POST/responses/201/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -2241,26 +1895,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Created.Body + public var body: Operations.ReactionsCreateForIssueComment.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Created.Body) { + public init(body: Operations.ReactionsCreateForIssueComment.Output.Created.Body) { self.body = body } } - /// Response + /// Reaction created /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-in-org)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Created) + case created(Operations.ReactionsCreateForIssueComment.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForTeamDiscussionInOrg.Output.Created { + public var created: Operations.ReactionsCreateForIssueComment.Output.Created { get throws { switch self { case let .created(response): @@ -2273,16 +1927,39 @@ public enum Operations { } } } - /// Undocumented response. + /// Validation failed, or the endpoint has been spammed. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/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: @@ -2304,63 +1981,61 @@ public enum Operations { } } } - /// Delete team discussion reaction + /// Delete an issue comment reaction /// /// > [!NOTE] - /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. - /// - /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). + /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)`. - public enum ReactionsDeleteForTeamDiscussion { - public static let id: Swift.String = "reactions/delete-for-team-discussion" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)`. + public enum ReactionsDeleteForIssueComment { + public static let id: Swift.String = "reactions/delete-for-issue-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// The unique identifier of the reaction. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/DELETE/path/reaction_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. public var reactionId: Components.Parameters.ReactionId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. /// - reactionId: The unique identifier of the reaction. public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId, reactionId: Components.Parameters.ReactionId ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.owner = owner + self.repo = repo + self.commentId = commentId self.reactionId = reactionId } } - public var path: Operations.ReactionsDeleteForTeamDiscussion.Input.Path + public var path: Operations.ReactionsDeleteForIssueComment.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReactionsDeleteForTeamDiscussion.Input.Path) { + public init(path: Operations.ReactionsDeleteForIssueComment.Input.Path) { self.path = path } } @@ -2371,13 +2046,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForTeamDiscussion.Output.NoContent) + case noContent(Operations.ReactionsDeleteForIssueComment.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}/delete(reactions/delete-for-team-discussion)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -2387,7 +2062,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReactionsDeleteForTeamDiscussion.Output.NoContent { + public var noContent: Operations.ReactionsDeleteForIssueComment.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -2406,49 +2081,49 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List reactions for a commit comment + /// List reactions for an issue /// - /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). + /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)`. - public enum ReactionsListForCommitComment { - public static let id: Swift.String = "reactions/list-for-commit-comment" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)`. + public enum ReactionsListForIssue { + public static let id: Swift.String = "reactions/list-for-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. + /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/path/comment_id`. - public var commentId: Components.Parameters.CommentId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. + /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo - self.commentId = commentId + self.issueNumber = issueNumber } } - public var path: Operations.ReactionsListForCommitComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query`. + public var path: Operations.ReactionsListForIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -2459,26 +2134,26 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. + /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForCommitComment.Input.Query.ContentPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/content`. + public var content: Operations.ReactionsListForIssue.Input.Query.ContentPayload? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. + /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. /// - 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( - content: Operations.ReactionsListForCommitComment.Input.Query.ContentPayload? = nil, + content: Operations.ReactionsListForIssue.Input.Query.ContentPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { @@ -2487,19 +2162,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ReactionsListForCommitComment.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/header`. + public var query: Operations.ReactionsListForIssue.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/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.ReactionsListForCommitComment.Input.Headers + public var headers: Operations.ReactionsListForIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2507,9 +2182,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ReactionsListForCommitComment.Input.Path, - query: Operations.ReactionsListForCommitComment.Input.Query = .init(), - headers: Operations.ReactionsListForCommitComment.Input.Headers = .init() + path: Operations.ReactionsListForIssue.Input.Path, + query: Operations.ReactionsListForIssue.Input.Query = .init(), + headers: Operations.ReactionsListForIssue.Input.Headers = .init() ) { self.path = path self.query = query @@ -2518,9 +2193,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -2531,10 +2206,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ReactionsListForCommitComment.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/content`. + public var headers: Operations.ReactionsListForIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/content/application\/json`. case json([Components.Schemas.Reaction]) /// The associated value of the enum case if `self` is `.json`. /// @@ -2550,15 +2225,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsListForCommitComment.Output.Ok.Body + public var body: Operations.ReactionsListForIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ReactionsListForCommitComment.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForCommitComment.Output.Ok.Body + headers: Operations.ReactionsListForIssue.Output.Ok.Headers = .init(), + body: Operations.ReactionsListForIssue.Output.Ok.Body ) { self.headers = headers self.body = body @@ -2566,15 +2241,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForCommitComment.Output.Ok) + case ok(Operations.ReactionsListForIssue.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.ReactionsListForCommitComment.Output.Ok { + public var ok: Operations.ReactionsListForIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -2589,7 +2264,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/get(reactions/list-for-commit-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -2610,6 +2285,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -2641,65 +2339,65 @@ public enum Operations { } } } - /// Create reaction for a commit comment + /// Create reaction for an issue /// - /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. + /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)`. - public enum ReactionsCreateForCommitComment { - public static let id: Swift.String = "reactions/create-for-commit-comment" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)`. + public enum ReactionsCreateForIssue { + public static let id: Swift.String = "reactions/create-for-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. + /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/path/comment_id`. - public var commentId: Components.Parameters.CommentId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. + /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo - self.commentId = commentId + self.issueNumber = issueNumber } } - public var path: Operations.ReactionsCreateForCommitComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/header`. + public var path: Operations.ReactionsCreateForIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/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.ReactionsCreateForCommitComment.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody`. + public var headers: Operations.ReactionsCreateForIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -2710,25 +2408,25 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload.ContentPayload + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json/content`. + public var content: Operations.ReactionsCreateForIssue.Input.Body.JsonPayload.ContentPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. - public init(content: Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload.ContentPayload) { + /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. + public init(content: Operations.ReactionsCreateForIssue.Input.Body.JsonPayload.ContentPayload) { self.content = content } public enum CodingKeys: String, CodingKey { case content } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForCommitComment.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/content/application\/json`. + case json(Operations.ReactionsCreateForIssue.Input.Body.JsonPayload) } - public var body: Operations.ReactionsCreateForCommitComment.Input.Body + public var body: Operations.ReactionsCreateForIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -2736,9 +2434,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReactionsCreateForCommitComment.Input.Path, - headers: Operations.ReactionsCreateForCommitComment.Input.Headers = .init(), - body: Operations.ReactionsCreateForCommitComment.Input.Body + path: Operations.ReactionsCreateForIssue.Input.Path, + headers: Operations.ReactionsCreateForIssue.Input.Headers = .init(), + body: Operations.ReactionsCreateForIssue.Input.Body ) { self.path = path self.headers = headers @@ -2747,9 +2445,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/200/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -2765,26 +2463,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body + public var body: Operations.ReactionsCreateForIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForCommitComment.Output.Ok.Body) { + public init(body: Operations.ReactionsCreateForIssue.Output.Ok.Body) { self.body = body } } - /// Reaction exists + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForCommitComment.Output.Ok) + case ok(Operations.ReactionsCreateForIssue.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.ReactionsCreateForCommitComment.Output.Ok { + public var ok: Operations.ReactionsCreateForIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -2798,9 +2496,9 @@ public enum Operations { } } public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/201/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -2816,26 +2514,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForCommitComment.Output.Created.Body + public var body: Operations.ReactionsCreateForIssue.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForCommitComment.Output.Created.Body) { + public init(body: Operations.ReactionsCreateForIssue.Output.Created.Body) { self.body = body } } - /// Reaction created + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForCommitComment.Output.Created) + case created(Operations.ReactionsCreateForIssue.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForCommitComment.Output.Created { + public var created: Operations.ReactionsCreateForIssue.Output.Created { get throws { switch self { case let .created(response): @@ -2850,7 +2548,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/post(reactions/create-for-commit-comment)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -2902,61 +2600,61 @@ public enum Operations { } } } - /// Delete a commit comment reaction + /// Delete an issue reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. /// - /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). + /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)`. - public enum ReactionsDeleteForCommitComment { - public static let id: Swift.String = "reactions/delete-for-commit-comment" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)`. + public enum ReactionsDeleteForIssue { + public static let id: Swift.String = "reactions/delete-for-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. + /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. - public var commentId: Components.Parameters.CommentId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber /// The unique identifier of the reaction. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/reaction_id`. public var reactionId: Components.Parameters.ReactionId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. + /// - issueNumber: The number that identifies the issue. /// - reactionId: The unique identifier of the reaction. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId, + issueNumber: Components.Parameters.IssueNumber, reactionId: Components.Parameters.ReactionId ) { self.owner = owner self.repo = repo - self.commentId = commentId + self.issueNumber = issueNumber self.reactionId = reactionId } } - public var path: Operations.ReactionsDeleteForCommitComment.Input.Path + public var path: Operations.ReactionsDeleteForIssue.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReactionsDeleteForCommitComment.Input.Path) { + public init(path: Operations.ReactionsDeleteForIssue.Input.Path) { self.path = path } } @@ -2967,13 +2665,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForCommitComment.Output.NoContent) + case noContent(Operations.ReactionsDeleteForIssue.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-commit-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -2983,7 +2681,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReactionsDeleteForCommitComment.Output.NoContent { + public var noContent: Operations.ReactionsDeleteForIssue.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -3002,28 +2700,28 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List reactions for an issue comment + /// List reactions for a pull request review comment /// - /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). + /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)`. - public enum ReactionsListForIssueComment { - public static let id: Swift.String = "reactions/list-for-issue-comment" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)`. + public enum ReactionsListForPullRequestReviewComment { + public static let id: Swift.String = "reactions/list-for-pull-request-review-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/repo`. public var repo: Components.Parameters.Repo /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/path/comment_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/comment_id`. public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// @@ -3041,10 +2739,10 @@ public enum Operations { self.commentId = commentId } } - public var path: Operations.ReactionsListForIssueComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query`. + public var path: Operations.ReactionsListForPullRequestReviewComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -3055,26 +2753,26 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. + /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForIssueComment.Input.Query.ContentPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/content`. + public var content: Operations.ReactionsListForPullRequestReviewComment.Input.Query.ContentPayload? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. + /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. /// - 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( - content: Operations.ReactionsListForIssueComment.Input.Query.ContentPayload? = nil, + content: Operations.ReactionsListForPullRequestReviewComment.Input.Query.ContentPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { @@ -3083,19 +2781,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ReactionsListForIssueComment.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/header`. + public var query: Operations.ReactionsListForPullRequestReviewComment.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/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.ReactionsListForIssueComment.Input.Headers + public var headers: Operations.ReactionsListForPullRequestReviewComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -3103,9 +2801,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ReactionsListForIssueComment.Input.Path, - query: Operations.ReactionsListForIssueComment.Input.Query = .init(), - headers: Operations.ReactionsListForIssueComment.Input.Headers = .init() + path: Operations.ReactionsListForPullRequestReviewComment.Input.Path, + query: Operations.ReactionsListForPullRequestReviewComment.Input.Query = .init(), + headers: Operations.ReactionsListForPullRequestReviewComment.Input.Headers = .init() ) { self.path = path self.query = query @@ -3114,9 +2812,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -3127,10 +2825,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ReactionsListForIssueComment.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/content`. + public var headers: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. case json([Components.Schemas.Reaction]) /// The associated value of the enum case if `self` is `.json`. /// @@ -3146,15 +2844,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsListForIssueComment.Output.Ok.Body + public var body: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ReactionsListForIssueComment.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForIssueComment.Output.Ok.Body + headers: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Headers = .init(), + body: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Body ) { self.headers = headers self.body = body @@ -3162,15 +2860,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForIssueComment.Output.Ok) + case ok(Operations.ReactionsListForPullRequestReviewComment.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.ReactionsListForIssueComment.Output.Ok { + public var ok: Operations.ReactionsListForPullRequestReviewComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -3185,7 +2883,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/get(reactions/list-for-issue-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3237,28 +2935,28 @@ public enum Operations { } } } - /// Create reaction for an issue comment + /// Create reaction for a pull request review comment /// - /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. + /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)`. - public enum ReactionsCreateForIssueComment { - public static let id: Swift.String = "reactions/create-for-issue-comment" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)`. + public enum ReactionsCreateForPullRequestReviewComment { + public static let id: Swift.String = "reactions/create-for-pull-request-review-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/repo`. public var repo: Components.Parameters.Repo /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/path/comment_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/comment_id`. public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// @@ -3276,26 +2974,26 @@ public enum Operations { self.commentId = commentId } } - public var path: Operations.ReactionsCreateForIssueComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/header`. + public var path: Operations.ReactionsCreateForPullRequestReviewComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/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.ReactionsCreateForIssueComment.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody`. + public var headers: Operations.ReactionsCreateForPullRequestReviewComment.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" case _hyphen_1 = "-1" @@ -3306,25 +3004,25 @@ public enum Operations { case rocket = "rocket" case eyes = "eyes" } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload.ContentPayload + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json/content`. + public var content: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload.ContentPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. - public init(content: Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload.ContentPayload) { + /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. + public init(content: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload.ContentPayload) { self.content = content } public enum CodingKeys: String, CodingKey { case content } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForIssueComment.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. + case json(Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload) } - public var body: Operations.ReactionsCreateForIssueComment.Input.Body + public var body: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -3332,9 +3030,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReactionsCreateForIssueComment.Input.Path, - headers: Operations.ReactionsCreateForIssueComment.Input.Headers = .init(), - body: Operations.ReactionsCreateForIssueComment.Input.Body + path: Operations.ReactionsCreateForPullRequestReviewComment.Input.Path, + headers: Operations.ReactionsCreateForPullRequestReviewComment.Input.Headers = .init(), + body: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body ) { self.path = path self.headers = headers @@ -3343,9 +3041,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -3361,26 +3059,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body + public var body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForIssueComment.Output.Ok.Body) { + public init(body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok.Body) { self.body = body } } /// Reaction exists /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForIssueComment.Output.Ok) + case ok(Operations.ReactionsCreateForPullRequestReviewComment.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.ReactionsCreateForIssueComment.Output.Ok { + public var ok: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -3394,9 +3092,9 @@ public enum Operations { } } public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -3412,26 +3110,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForIssueComment.Output.Created.Body + public var body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForIssueComment.Output.Created.Body) { + public init(body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created.Body) { self.body = body } } /// Reaction created /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForIssueComment.Output.Created) + case created(Operations.ReactionsCreateForPullRequestReviewComment.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForIssueComment.Output.Created { + public var created: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created { get throws { switch self { case let .created(response): @@ -3446,7 +3144,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/post(reactions/create-for-issue-comment)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -3498,35 +3196,35 @@ public enum Operations { } } } - /// Delete an issue comment reaction + /// Delete a pull request comment reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` /// - /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). + /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)`. - public enum ReactionsDeleteForIssueComment { - public static let id: Swift.String = "reactions/delete-for-issue-comment" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)`. + public enum ReactionsDeleteForPullRequestComment { + public static let id: Swift.String = "reactions/delete-for-pull-request-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. public var commentId: Components.Parameters.CommentId /// The unique identifier of the reaction. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. public var reactionId: Components.Parameters.ReactionId /// Creates a new `Path`. /// @@ -3547,12 +3245,12 @@ public enum Operations { self.reactionId = reactionId } } - public var path: Operations.ReactionsDeleteForIssueComment.Input.Path + public var path: Operations.ReactionsDeleteForPullRequestComment.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReactionsDeleteForIssueComment.Input.Path) { + public init(path: Operations.ReactionsDeleteForPullRequestComment.Input.Path) { self.path = path } } @@ -3563,13 +3261,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForIssueComment.Output.NoContent) + case noContent(Operations.ReactionsDeleteForPullRequestComment.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-issue-comment)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -3579,7 +3277,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReactionsDeleteForIssueComment.Output.NoContent { + public var noContent: Operations.ReactionsDeleteForPullRequestComment.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -3598,79 +3296,77 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List reactions for an issue + /// List reactions for a release /// - /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). + /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)`. - public enum ReactionsListForIssue { - public static let id: Swift.String = "reactions/list-for-issue" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/{release_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)`. + public enum ReactionsListForRelease { + public static let id: Swift.String = "reactions/list-for-release" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. + /// The unique identifier of the release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/release_id`. + public var releaseId: Components.Parameters.ReleaseId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. + /// - releaseId: The unique identifier of the release. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + releaseId: Components.Parameters.ReleaseId ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber + self.releaseId = releaseId } } - public var path: Operations.ReactionsListForIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query`. + public var path: Operations.ReactionsListForRelease.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" - case _hyphen_1 = "-1" case laugh = "laugh" - case confused = "confused" case heart = "heart" case hooray = "hooray" case rocket = "rocket" case eyes = "eyes" } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. + /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForIssue.Input.Query.ContentPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/content`. + public var content: Operations.ReactionsListForRelease.Input.Query.ContentPayload? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. + /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. /// - 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( - content: Operations.ReactionsListForIssue.Input.Query.ContentPayload? = nil, + content: Operations.ReactionsListForRelease.Input.Query.ContentPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { @@ -3679,19 +3375,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ReactionsListForIssue.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/header`. + public var query: Operations.ReactionsListForRelease.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/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.ReactionsListForIssue.Input.Headers + public var headers: Operations.ReactionsListForRelease.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -3699,9 +3395,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ReactionsListForIssue.Input.Path, - query: Operations.ReactionsListForIssue.Input.Query = .init(), - headers: Operations.ReactionsListForIssue.Input.Headers = .init() + path: Operations.ReactionsListForRelease.Input.Path, + query: Operations.ReactionsListForRelease.Input.Query = .init(), + headers: Operations.ReactionsListForRelease.Input.Headers = .init() ) { self.path = path self.query = query @@ -3710,9 +3406,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -3723,10 +3419,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ReactionsListForIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/content`. + public var headers: Operations.ReactionsListForRelease.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/content/application\/json`. case json([Components.Schemas.Reaction]) /// The associated value of the enum case if `self` is `.json`. /// @@ -3742,15 +3438,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsListForIssue.Output.Ok.Body + public var body: Operations.ReactionsListForRelease.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ReactionsListForIssue.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForIssue.Output.Ok.Body + headers: Operations.ReactionsListForRelease.Output.Ok.Headers = .init(), + body: Operations.ReactionsListForRelease.Output.Ok.Body ) { self.headers = headers self.body = body @@ -3758,15 +3454,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForIssue.Output.Ok) + case ok(Operations.ReactionsListForRelease.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.ReactionsListForIssue.Output.Ok { + public var ok: Operations.ReactionsListForRelease.Output.Ok { get throws { switch self { case let .ok(response): @@ -3781,7 +3477,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3802,29 +3498,6 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/get(reactions/list-for-issue)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -3856,94 +3529,92 @@ public enum Operations { } } } - /// Create reaction for an issue + /// Create reaction for a release /// - /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. + /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)`. - public enum ReactionsCreateForIssue { - public static let id: Swift.String = "reactions/create-for-issue" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases/{release_id}/reactions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)`. + public enum ReactionsCreateForRelease { + public static let id: Swift.String = "reactions/create-for-release" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. + /// The unique identifier of the release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/release_id`. + public var releaseId: Components.Parameters.ReleaseId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. + /// - releaseId: The unique identifier of the release. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + releaseId: Components.Parameters.ReleaseId ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber + self.releaseId = releaseId } } - public var path: Operations.ReactionsCreateForIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/header`. + public var path: Operations.ReactionsCreateForRelease.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/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.ReactionsCreateForIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody`. + public var headers: Operations.ReactionsCreateForRelease.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json/content`. @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { case _plus_1 = "+1" - case _hyphen_1 = "-1" case laugh = "laugh" - case confused = "confused" case heart = "heart" case hooray = "hooray" case rocket = "rocket" case eyes = "eyes" } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. + /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForIssue.Input.Body.JsonPayload.ContentPayload + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json/content`. + public var content: Operations.ReactionsCreateForRelease.Input.Body.JsonPayload.ContentPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. - public init(content: Operations.ReactionsCreateForIssue.Input.Body.JsonPayload.ContentPayload) { + /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. + public init(content: Operations.ReactionsCreateForRelease.Input.Body.JsonPayload.ContentPayload) { self.content = content } public enum CodingKeys: String, CodingKey { case content } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForIssue.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/content/application\/json`. + case json(Operations.ReactionsCreateForRelease.Input.Body.JsonPayload) } - public var body: Operations.ReactionsCreateForIssue.Input.Body + public var body: Operations.ReactionsCreateForRelease.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -3951,9 +3622,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReactionsCreateForIssue.Input.Path, - headers: Operations.ReactionsCreateForIssue.Input.Headers = .init(), - body: Operations.ReactionsCreateForIssue.Input.Body + path: Operations.ReactionsCreateForRelease.Input.Path, + headers: Operations.ReactionsCreateForRelease.Input.Headers = .init(), + body: Operations.ReactionsCreateForRelease.Input.Body ) { self.path = path self.headers = headers @@ -3962,9 +3633,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/200/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -3980,26 +3651,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForIssue.Output.Ok.Body + public var body: Operations.ReactionsCreateForRelease.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForIssue.Output.Ok.Body) { + public init(body: Operations.ReactionsCreateForRelease.Output.Ok.Body) { self.body = body } } - /// Response + /// Reaction exists /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForIssue.Output.Ok) + case ok(Operations.ReactionsCreateForRelease.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.ReactionsCreateForIssue.Output.Ok { + public var ok: Operations.ReactionsCreateForRelease.Output.Ok { get throws { switch self { case let .ok(response): @@ -4013,9 +3684,9 @@ public enum Operations { } } public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/POST/responses/201/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/201/content/application\/json`. case json(Components.Schemas.Reaction) /// The associated value of the enum case if `self` is `.json`. /// @@ -4031,26 +3702,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReactionsCreateForIssue.Output.Created.Body + public var body: Operations.ReactionsCreateForRelease.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForIssue.Output.Created.Body) { + public init(body: Operations.ReactionsCreateForRelease.Output.Created.Body) { self.body = body } } - /// Response + /// Reaction created /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForIssue.Output.Created) + case created(Operations.ReactionsCreateForRelease.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForIssue.Output.Created { + public var created: Operations.ReactionsCreateForRelease.Output.Created { get throws { switch self { case let .created(response): @@ -4065,7 +3736,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/post(reactions/create-for-issue)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -4117,61 +3788,61 @@ public enum Operations { } } } - /// Delete an issue reaction + /// Delete a release reaction /// /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. + /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`. /// - /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). + /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)`. - public enum ReactionsDeleteForIssue { - public static let id: Swift.String = "reactions/delete-for-issue" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path`. - public struct Path: Sendable, Hashable { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)`. + public enum ReactionsDeleteForRelease { + public static let id: Swift.String = "reactions/delete-for-release" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path`. + public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. + /// The unique identifier of the release. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/release_id`. + public var releaseId: Components.Parameters.ReleaseId /// The unique identifier of the reaction. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/DELETE/path/reaction_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. public var reactionId: Components.Parameters.ReactionId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. + /// - releaseId: The unique identifier of the release. /// - reactionId: The unique identifier of the reaction. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, + releaseId: Components.Parameters.ReleaseId, reactionId: Components.Parameters.ReactionId ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber + self.releaseId = releaseId self.reactionId = reactionId } } - public var path: Operations.ReactionsDeleteForIssue.Input.Path + public var path: Operations.ReactionsDeleteForRelease.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReactionsDeleteForIssue.Input.Path) { + public init(path: Operations.ReactionsDeleteForRelease.Input.Path) { self.path = path } } @@ -4182,13 +3853,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForIssue.Output.NoContent) + case noContent(Operations.ReactionsDeleteForRelease.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}/delete(reactions/delete-for-issue)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -4198,7 +3869,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReactionsDeleteForIssue.Output.NoContent { + public var noContent: Operations.ReactionsDeleteForRelease.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -4217,2000 +3888,4 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List reactions for a pull request review comment - /// - /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)`. - public enum ReactionsListForPullRequestReviewComment { - public static let id: Swift.String = "reactions/list-for-pull-request-review-comment" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/path/comment_id`. - public var commentId: Components.Parameters.CommentId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId - ) { - self.owner = owner - self.repo = repo - self.commentId = commentId - } - } - public var path: Operations.ReactionsListForPullRequestReviewComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForPullRequestReviewComment.Input.Query.ContentPayload? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. - /// - 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( - content: Operations.ReactionsListForPullRequestReviewComment.Input.Query.ContentPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.content = content - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ReactionsListForPullRequestReviewComment.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsListForPullRequestReviewComment.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ReactionsListForPullRequestReviewComment.Input.Path, - query: Operations.ReactionsListForPullRequestReviewComment.Input.Query = .init(), - headers: Operations.ReactionsListForPullRequestReviewComment.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/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.ReactionsListForPullRequestReviewComment.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Reaction]) - /// 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.Reaction] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForPullRequestReviewComment.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForPullRequestReviewComment.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.ReactionsListForPullRequestReviewComment.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/get(reactions/list-for-pull-request-review-comment)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create reaction for a pull request review comment - /// - /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)`. - public enum ReactionsCreateForPullRequestReviewComment { - public static let id: Swift.String = "reactions/create-for-pull-request-review-comment" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/path/comment_id`. - public var commentId: Components.Parameters.CommentId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId - ) { - self.owner = owner - self.repo = repo - self.commentId = commentId - } - } - public var path: Operations.ReactionsCreateForPullRequestReviewComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsCreateForPullRequestReviewComment.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload.ContentPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. - public init(content: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload.ContentPayload) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForPullRequestReviewComment.Input.Body.JsonPayload) - } - public var body: Operations.ReactionsCreateForPullRequestReviewComment.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ReactionsCreateForPullRequestReviewComment.Input.Path, - headers: Operations.ReactionsCreateForPullRequestReviewComment.Input.Headers = .init(), - body: Operations.ReactionsCreateForPullRequestReviewComment.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/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/200/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Ok.Body) { - self.body = body - } - } - /// Reaction exists - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForPullRequestReviewComment.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.ReactionsCreateForPullRequestReviewComment.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created.Body) { - self.body = body - } - } - /// Reaction created - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForPullRequestReviewComment.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForPullRequestReviewComment.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/post(reactions/create-for-pull-request-review-comment)/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 - ] - } - } - } - /// Delete a pull request comment reaction - /// - /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` - /// - /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)`. - public enum ReactionsDeleteForPullRequestComment { - public static let id: Swift.String = "reactions/delete-for-pull-request-comment" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/comment_id`. - public var commentId: Components.Parameters.CommentId - /// The unique identifier of the reaction. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. - public var reactionId: Components.Parameters.ReactionId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. - /// - reactionId: The unique identifier of the reaction. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId, - reactionId: Components.Parameters.ReactionId - ) { - self.owner = owner - self.repo = repo - self.commentId = commentId - self.reactionId = reactionId - } - } - public var path: Operations.ReactionsDeleteForPullRequestComment.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ReactionsDeleteForPullRequestComment.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//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForPullRequestComment.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}/delete(reactions/delete-for-pull-request-comment)/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.ReactionsDeleteForPullRequestComment.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List reactions for a release - /// - /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/{release_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)`. - public enum ReactionsListForRelease { - public static let id: Swift.String = "reactions/list-for-release" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/path/release_id`. - public var releaseId: Components.Parameters.ReleaseId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - releaseId: The unique identifier of the release. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - releaseId: Components.Parameters.ReleaseId - ) { - self.owner = owner - self.repo = repo - self.releaseId = releaseId - } - } - public var path: Operations.ReactionsListForRelease.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case laugh = "laugh" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForRelease.Input.Query.ContentPayload? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. - /// - 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( - content: Operations.ReactionsListForRelease.Input.Query.ContentPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.content = content - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ReactionsListForRelease.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsListForRelease.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ReactionsListForRelease.Input.Path, - query: Operations.ReactionsListForRelease.Input.Query = .init(), - headers: Operations.ReactionsListForRelease.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/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.ReactionsListForRelease.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Reaction]) - /// 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.Reaction] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsListForRelease.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ReactionsListForRelease.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForRelease.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForRelease.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.ReactionsListForRelease.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/get(reactions/list-for-release)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create reaction for a release - /// - /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases/{release_id}/reactions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)`. - public enum ReactionsCreateForRelease { - public static let id: Swift.String = "reactions/create-for-release" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/path/release_id`. - public var releaseId: Components.Parameters.ReleaseId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - releaseId: The unique identifier of the release. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - releaseId: Components.Parameters.ReleaseId - ) { - self.owner = owner - self.repo = repo - self.releaseId = releaseId - } - } - public var path: Operations.ReactionsCreateForRelease.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsCreateForRelease.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case laugh = "laugh" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForRelease.Input.Body.JsonPayload.ContentPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. - public init(content: Operations.ReactionsCreateForRelease.Input.Body.JsonPayload.ContentPayload) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForRelease.Input.Body.JsonPayload) - } - public var body: Operations.ReactionsCreateForRelease.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ReactionsCreateForRelease.Input.Path, - headers: Operations.ReactionsCreateForRelease.Input.Headers = .init(), - body: Operations.ReactionsCreateForRelease.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/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/200/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForRelease.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForRelease.Output.Ok.Body) { - self.body = body - } - } - /// Reaction exists - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsCreateForRelease.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.ReactionsCreateForRelease.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForRelease.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForRelease.Output.Created.Body) { - self.body = body - } - } - /// Reaction created - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForRelease.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForRelease.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/post(reactions/create-for-release)/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 - ] - } - } - } - /// Delete a release reaction - /// - /// > [!NOTE] - /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`. - /// - /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)`. - public enum ReactionsDeleteForRelease { - public static let id: Swift.String = "reactions/delete-for-release" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the release. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/release_id`. - public var releaseId: Components.Parameters.ReleaseId - /// The unique identifier of the reaction. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/DELETE/path/reaction_id`. - public var reactionId: Components.Parameters.ReactionId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - releaseId: The unique identifier of the release. - /// - reactionId: The unique identifier of the reaction. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - releaseId: Components.Parameters.ReleaseId, - reactionId: Components.Parameters.ReactionId - ) { - self.owner = owner - self.repo = repo - self.releaseId = releaseId - self.reactionId = reactionId - } - } - public var path: Operations.ReactionsDeleteForRelease.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ReactionsDeleteForRelease.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//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ReactionsDeleteForRelease.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}/delete(reactions/delete-for-release)/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.ReactionsDeleteForRelease.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List reactions for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. - /// - /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-legacy)`. - public enum ReactionsListForTeamDiscussionCommentLegacy { - public static let id: Swift.String = "reactions/list-for-team-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Query.ContentPayload? - /// 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/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/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/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. - /// - 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( - content: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Query.ContentPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.content = content - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Path, - query: Operations.ReactionsListForTeamDiscussionCommentLegacy.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionCommentLegacy.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/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/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.ReactionsListForTeamDiscussionCommentLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Reaction]) - /// 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.Reaction] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsListForTeamDiscussionCommentLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ReactionsListForTeamDiscussionCommentLegacy.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForTeamDiscussionCommentLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/get(reactions/list-for-team-discussion-comment-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForTeamDiscussionCommentLegacy.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.ReactionsListForTeamDiscussionCommentLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create reaction for a team discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. - /// - /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-legacy)`. - public enum ReactionsCreateForTeamDiscussionCommentLegacy { - public static let id: Swift.String = "reactions/create-for-team-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Body.JsonPayload.ContentPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. - public init(content: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Body.JsonPayload.ContentPayload) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Body.JsonPayload) - } - public var body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.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/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions/post(reactions/create-for-team-discussion-comment-legacy)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForTeamDiscussionCommentLegacy.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List reactions for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. - /// - /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-legacy)`. - public enum ReactionsListForTeamDiscussionLegacy { - public static let id: Swift.String = "reactions/list-for-team-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.ReactionsListForTeamDiscussionLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/query/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/query/content`. - public var content: Operations.ReactionsListForTeamDiscussionLegacy.Input.Query.ContentPayload? - /// 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/teams/{team_id}/discussions/{discussion_number}/reactions/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/teams/{team_id}/discussions/{discussion_number}/reactions/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - content: Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. - /// - 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( - content: Operations.ReactionsListForTeamDiscussionLegacy.Input.Query.ContentPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.content = content - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ReactionsListForTeamDiscussionLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsListForTeamDiscussionLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ReactionsListForTeamDiscussionLegacy.Input.Path, - query: Operations.ReactionsListForTeamDiscussionLegacy.Input.Query = .init(), - headers: Operations.ReactionsListForTeamDiscussionLegacy.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/teams/{team_id}/discussions/{discussion_number}/reactions/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/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.ReactionsListForTeamDiscussionLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Reaction]) - /// 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.Reaction] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsListForTeamDiscussionLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ReactionsListForTeamDiscussionLegacy.Output.Ok.Headers = .init(), - body: Operations.ReactionsListForTeamDiscussionLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/get(reactions/list-for-team-discussion-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReactionsListForTeamDiscussionLegacy.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.ReactionsListForTeamDiscussionLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create reaction for a team discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. - /// - /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). - /// - /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/reactions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-legacy)`. - public enum ReactionsCreateForTeamDiscussionLegacy { - public static let id: Swift.String = "reactions/create-for-team-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/requestBody/json/content`. - @frozen public enum ContentPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh = "laugh" - case confused = "confused" - case heart = "heart" - case hooray = "hooray" - case rocket = "rocket" - case eyes = "eyes" - } - /// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/requestBody/json/content`. - public var content: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Body.JsonPayload.ContentPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. - public init(content: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Body.JsonPayload.ContentPayload) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/requestBody/content/application\/json`. - case json(Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Body.JsonPayload) - } - public var body: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Path, - headers: Operations.ReactionsCreateForTeamDiscussionLegacy.Input.Headers = .init(), - body: Operations.ReactionsCreateForTeamDiscussionLegacy.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/teams/{team_id}/discussions/{discussion_number}/reactions/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/reactions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Reaction) - /// 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.Reaction { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReactionsCreateForTeamDiscussionLegacy.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReactionsCreateForTeamDiscussionLegacy.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/reactions/post(reactions/create-for-team-discussion-legacy)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ReactionsCreateForTeamDiscussionLegacy.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ReactionsCreateForTeamDiscussionLegacy.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } } From 3d96f64db556fb87ed56a0b6425ef3775c78c969 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:13:54 +0000 Subject: [PATCH 20/33] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 434 ++----- Sources/repos/Types.swift | 2394 +++++++++++++++++------------------- 2 files changed, 1198 insertions(+), 1630 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 2f93a1be99..8293691e91 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -487,6 +487,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -987,6 +1009,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -8279,7 +8323,18 @@ public struct Client: APIProtocol { 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 { @@ -16567,6 +16622,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -17071,6 +17148,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -18047,339 +18146,6 @@ public struct Client: APIProtocol { } ) } - /// Closing down - List tag protection states for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. - /// - /// This returns the tag protection states of a repository. - /// - /// This information is only available to repository administrators. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)`. - @available(*, deprecated) - public func reposListTagProtection(_ input: Operations.ReposListTagProtection.Input) async throws -> Operations.ReposListTagProtection.Output { - try await client.send( - input: input, - forOperation: Operations.ReposListTagProtection.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/tags/protection", - parameters: [ - input.path.owner, - input.path.repo - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReposListTagProtection.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.TagProtection].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Closing down - Create a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. - /// - /// This creates a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)`. - @available(*, deprecated) - public func reposCreateTagProtection(_ input: Operations.ReposCreateTagProtection.Input) async throws -> Operations.ReposCreateTagProtection.Output { - try await client.send( - input: input, - forOperation: Operations.ReposCreateTagProtection.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/tags/protection", - parameters: [ - input.path.owner, - input.path.repo - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReposCreateTagProtection.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.TagProtection.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Closing down - Delete a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. - /// - /// This deletes a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)`. - @available(*, deprecated) - public func reposDeleteTagProtection(_ input: Operations.ReposDeleteTagProtection.Input) async throws -> Operations.ReposDeleteTagProtection.Output { - try await client.send( - input: input, - forOperation: Operations.ReposDeleteTagProtection.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/tags/protection/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.tagProtectionId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } /// Download a repository archive (tar) /// /// Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index dc08f8a401..bd393eb601 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1923,43 +1923,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/get(repos/list-tags)`. func reposListTags(_ input: Operations.ReposListTags.Input) async throws -> Operations.ReposListTags.Output - /// Closing down - List tag protection states for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. - /// - /// This returns the tag protection states of a repository. - /// - /// This information is only available to repository administrators. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)`. - @available(*, deprecated) - func reposListTagProtection(_ input: Operations.ReposListTagProtection.Input) async throws -> Operations.ReposListTagProtection.Output - /// Closing down - Create a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. - /// - /// This creates a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)`. - @available(*, deprecated) - func reposCreateTagProtection(_ input: Operations.ReposCreateTagProtection.Input) async throws -> Operations.ReposCreateTagProtection.Output - /// Closing down - Delete a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. - /// - /// This deletes a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)`. - @available(*, deprecated) - func reposDeleteTagProtection(_ input: Operations.ReposDeleteTagProtection.Input) async throws -> Operations.ReposDeleteTagProtection.Output /// Download a repository archive (tar) /// /// Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually @@ -3753,12 +3716,14 @@ extension APIProtocol { public func reposGetContent( path: Operations.ReposGetContent.Input.Path, query: Operations.ReposGetContent.Input.Query = .init(), - headers: Operations.ReposGetContent.Input.Headers = .init() + headers: Operations.ReposGetContent.Input.Headers = .init(), + body: Operations.ReposGetContent.Input.Body? = nil ) async throws -> Operations.ReposGetContent.Output { try await reposGetContent(Operations.ReposGetContent.Input( path: path, query: query, - headers: headers + headers: headers, + body: body )) } /// Create or update file contents @@ -5605,69 +5570,6 @@ extension APIProtocol { headers: headers )) } - /// Closing down - List tag protection states for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. - /// - /// This returns the tag protection states of a repository. - /// - /// This information is only available to repository administrators. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)`. - @available(*, deprecated) - public func reposListTagProtection( - path: Operations.ReposListTagProtection.Input.Path, - headers: Operations.ReposListTagProtection.Input.Headers = .init() - ) async throws -> Operations.ReposListTagProtection.Output { - try await reposListTagProtection(Operations.ReposListTagProtection.Input( - path: path, - headers: headers - )) - } - /// Closing down - Create a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. - /// - /// This creates a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)`. - @available(*, deprecated) - public func reposCreateTagProtection( - path: Operations.ReposCreateTagProtection.Input.Path, - headers: Operations.ReposCreateTagProtection.Input.Headers = .init(), - body: Operations.ReposCreateTagProtection.Input.Body - ) async throws -> Operations.ReposCreateTagProtection.Output { - try await reposCreateTagProtection(Operations.ReposCreateTagProtection.Input( - path: path, - headers: headers, - body: body - )) - } - /// Closing down - Delete a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. - /// - /// This deletes a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)`. - @available(*, deprecated) - public func reposDeleteTagProtection( - path: Operations.ReposDeleteTagProtection.Input.Path, - headers: Operations.ReposDeleteTagProtection.Input.Headers = .init() - ) async throws -> Operations.ReposDeleteTagProtection.Output { - try await reposDeleteTagProtection(Operations.ReposDeleteTagProtection.Input( - path: path, - headers: headers - )) - } /// Download a repository archive (tar) /// /// Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually @@ -6338,8 +6240,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -6358,7 +6260,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -6430,7 +6332,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -6460,7 +6362,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -6582,8 +6484,8 @@ public enum Components { case case1(Swift.String) /// - Remark: Generated from `#/components/schemas/webhook-config-insecure-ssl/case2`. case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -6602,7 +6504,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -6834,8 +6736,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -6860,7 +6762,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -7002,10 +6904,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -7026,10 +6928,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -7071,10 +6973,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -7576,6 +7478,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -7821,6 +7742,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -7918,6 +7842,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -8015,6 +7942,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -8113,6 +8043,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -8328,8 +8261,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -8348,7 +8281,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -8420,7 +8353,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -8450,7 +8383,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -8636,6 +8569,289 @@ public enum Components { case rocket } } + /// Data related to a release. + /// + /// - Remark: Generated from `#/components/schemas/release-asset`. + public struct ReleaseAsset: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release-asset/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/browser_download_url`. + public var browserDownloadUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/node_id`. + public var nodeId: Swift.String + /// The file name of the asset. + /// + /// - Remark: Generated from `#/components/schemas/release-asset/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/label`. + public var label: Swift.String? + /// State of the release asset. + /// + /// - Remark: Generated from `#/components/schemas/release-asset/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case uploaded = "uploaded" + case open = "open" + } + /// State of the release asset. + /// + /// - Remark: Generated from `#/components/schemas/release-asset/state`. + public var state: Components.Schemas.ReleaseAsset.StatePayload + /// - Remark: Generated from `#/components/schemas/release-asset/content_type`. + public var contentType: Swift.String + /// - Remark: Generated from `#/components/schemas/release-asset/size`. + public var size: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/components/schemas/release-asset/download_count`. + public var downloadCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release-asset/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release-asset/uploader`. + public var uploader: Components.Schemas.NullableSimpleUser? + /// Creates a new `ReleaseAsset`. + /// + /// - Parameters: + /// - url: + /// - browserDownloadUrl: + /// - id: + /// - nodeId: + /// - name: The file name of the asset. + /// - label: + /// - state: State of the release asset. + /// - contentType: + /// - size: + /// - digest: + /// - downloadCount: + /// - createdAt: + /// - updatedAt: + /// - uploader: + public init( + url: Swift.String, + browserDownloadUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + label: Swift.String? = nil, + state: Components.Schemas.ReleaseAsset.StatePayload, + contentType: Swift.String, + size: Swift.Int, + digest: Swift.String? = nil, + downloadCount: Swift.Int, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + uploader: Components.Schemas.NullableSimpleUser? = nil + ) { + self.url = url + self.browserDownloadUrl = browserDownloadUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.label = label + self.state = state + self.contentType = contentType + self.size = size + self.digest = digest + self.downloadCount = downloadCount + self.createdAt = createdAt + self.updatedAt = updatedAt + self.uploader = uploader + } + public enum CodingKeys: String, CodingKey { + case url + case browserDownloadUrl = "browser_download_url" + case id + case nodeId = "node_id" + case name + case label + case state + case contentType = "content_type" + case size + case digest + case downloadCount = "download_count" + case createdAt = "created_at" + case updatedAt = "updated_at" + case uploader + } + } + /// A release. + /// + /// - Remark: Generated from `#/components/schemas/release`. + public struct Release: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/release/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/release/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/assets_url`. + public var assetsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/upload_url`. + public var uploadUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/release/tarball_url`. + public var tarballUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/zipball_url`. + public var zipballUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/release/node_id`. + public var nodeId: Swift.String + /// The name of the tag. + /// + /// - Remark: Generated from `#/components/schemas/release/tag_name`. + public var tagName: Swift.String + /// Specifies the commitish value that determines where the Git tag is created from. + /// + /// - Remark: Generated from `#/components/schemas/release/target_commitish`. + public var targetCommitish: Swift.String + /// - Remark: Generated from `#/components/schemas/release/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/body`. + public var body: Swift.String? + /// true to create a draft (unpublished) release, false to create a published one. + /// + /// - Remark: Generated from `#/components/schemas/release/draft`. + public var draft: Swift.Bool + /// Whether to identify the release as a prerelease or a full release. + /// + /// - Remark: Generated from `#/components/schemas/release/prerelease`. + public var prerelease: Swift.Bool + /// Whether or not the release is immutable. + /// + /// - Remark: Generated from `#/components/schemas/release/immutable`. + public var immutable: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/release/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/release/published_at`. + public var publishedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/release/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/release/author`. + public var author: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/release/assets`. + public var assets: [Components.Schemas.ReleaseAsset] + /// - Remark: Generated from `#/components/schemas/release/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/mentions_count`. + public var mentionsCount: Swift.Int? + /// The URL of the release discussion. + /// + /// - Remark: Generated from `#/components/schemas/release/discussion_url`. + public var discussionUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/release/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// Creates a new `Release`. + /// + /// - Parameters: + /// - url: + /// - htmlUrl: + /// - assetsUrl: + /// - uploadUrl: + /// - tarballUrl: + /// - zipballUrl: + /// - id: + /// - nodeId: + /// - tagName: The name of the tag. + /// - targetCommitish: Specifies the commitish value that determines where the Git tag is created from. + /// - name: + /// - body: + /// - draft: true to create a draft (unpublished) release, false to create a published one. + /// - prerelease: Whether to identify the release as a prerelease or a full release. + /// - immutable: Whether or not the release is immutable. + /// - createdAt: + /// - publishedAt: + /// - updatedAt: + /// - author: + /// - assets: + /// - bodyHtml: + /// - bodyText: + /// - mentionsCount: + /// - discussionUrl: The URL of the release discussion. + /// - reactions: + public init( + url: Swift.String, + htmlUrl: Swift.String, + assetsUrl: Swift.String, + uploadUrl: Swift.String, + tarballUrl: Swift.String? = nil, + zipballUrl: Swift.String? = nil, + id: Swift.Int, + nodeId: Swift.String, + tagName: Swift.String, + targetCommitish: Swift.String, + name: Swift.String? = nil, + body: Swift.String? = nil, + draft: Swift.Bool, + prerelease: Swift.Bool, + immutable: Swift.Bool? = nil, + createdAt: Foundation.Date, + publishedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + author: Components.Schemas.SimpleUser, + assets: [Components.Schemas.ReleaseAsset], + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil, + mentionsCount: Swift.Int? = nil, + discussionUrl: Swift.String? = nil, + reactions: Components.Schemas.ReactionRollup? = nil + ) { + self.url = url + self.htmlUrl = htmlUrl + self.assetsUrl = assetsUrl + self.uploadUrl = uploadUrl + self.tarballUrl = tarballUrl + self.zipballUrl = zipballUrl + self.id = id + self.nodeId = nodeId + self.tagName = tagName + self.targetCommitish = targetCommitish + self.name = name + self.body = body + self.draft = draft + self.prerelease = prerelease + self.immutable = immutable + self.createdAt = createdAt + self.publishedAt = publishedAt + self.updatedAt = updatedAt + self.author = author + self.assets = assets + self.bodyHtml = bodyHtml + self.bodyText = bodyText + self.mentionsCount = mentionsCount + self.discussionUrl = discussionUrl + self.reactions = reactions + } + public enum CodingKeys: String, CodingKey { + case url + case htmlUrl = "html_url" + case assetsUrl = "assets_url" + case uploadUrl = "upload_url" + case tarballUrl = "tarball_url" + case zipballUrl = "zipball_url" + case id + case nodeId = "node_id" + case tagName = "tag_name" + case targetCommitish = "target_commitish" + case name + case body + case draft + case prerelease + case immutable + case createdAt = "created_at" + case publishedAt = "published_at" + case updatedAt = "updated_at" + case author + case assets + case bodyHtml = "body_html" + case bodyText = "body_text" + case mentionsCount = "mentions_count" + case discussionUrl = "discussion_url" + case reactions + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { /// Enable or disable GitHub Advanced Security for the repository. @@ -8810,6 +9026,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -8820,6 +9137,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -8827,7 +9147,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -8836,6 +9159,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -8845,6 +9171,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -8987,6 +9316,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -9122,10 +9466,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -9203,6 +9547,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -9292,6 +9639,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -9381,6 +9731,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -9471,6 +9824,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -9494,79 +9850,13 @@ public enum Components { case customProperties = "custom_properties" } } - /// Custom property name and associated value - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value`. - public struct CustomPropertyValue: Codable, Hashable, Sendable { - /// The name of the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. - public var propertyName: Swift.String - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - public var value: Components.Schemas.CustomPropertyValue.ValuePayload? - /// Creates a new `CustomPropertyValue`. - /// - /// - Parameters: - /// - propertyName: The name of the property - /// - value: The value assigned to the property - public init( - propertyName: Swift.String, - value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil - ) { - self.propertyName = propertyName - self.value = value - } - public enum CodingKeys: String, CodingKey { - case propertyName = "property_name" - case value - } - } /// An object without any properties. /// /// - Remark: Generated from `#/components/schemas/empty-object`. public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -10372,6 +10662,72 @@ public enum Components { case draft } } + /// Custom property name and associated value + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value`. + public struct CustomPropertyValue: Codable, Hashable, Sendable { + /// The name of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. + public var propertyName: Swift.String + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + public var value: Components.Schemas.CustomPropertyValue.ValuePayload? + /// Creates a new `CustomPropertyValue`. + /// + /// - Parameters: + /// - propertyName: The name of the property + /// - value: The value assigned to the property + public init( + propertyName: Swift.String, + value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil + ) { + self.propertyName = propertyName + self.value = value + } + public enum CodingKeys: String, CodingKey { + case propertyName = "property_name" + case value + } + } /// A repository on GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-repository`. @@ -10580,6 +10936,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -10825,6 +11200,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -10922,6 +11300,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -11019,6 +11400,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -11117,6 +11501,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -11322,6 +11709,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/has_discussions`. public var hasDiscussions: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -11518,10 +11920,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -11599,6 +12001,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -11703,6 +12108,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -11807,6 +12215,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -11912,6 +12323,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -11962,7 +12376,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor`. public struct RepositoryRulesetBypassActor: Codable, Hashable, Sendable { - /// The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, `actor_id` is ignored. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_id`. public var actorId: Swift.Int? @@ -11995,7 +12409,7 @@ public enum Components { /// Creates a new `RepositoryRulesetBypassActor`. /// /// - Parameters: - /// - actorId: The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// - actorId: The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, `actor_id` is ignored. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// - actorType: The type of actor that can bypass a ruleset. /// - bypassMode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. public init( @@ -12258,11 +12672,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -12291,11 +12705,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -12324,11 +12738,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -12337,8 +12751,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. case case3(Components.Schemas.OrgRulesetConditions.Case3Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -12363,7 +12777,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -12661,6 +13075,76 @@ public enum Components { case _type = "type" } } + /// A required reviewing team + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-reviewer`. + public struct RepositoryRuleParamsReviewer: Codable, Hashable, Sendable { + /// ID of the reviewer which must review changes to matching files. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-reviewer/id`. + public var id: Swift.Int + /// The type of the reviewer + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-reviewer/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "Team" + } + /// The type of the reviewer + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-reviewer/type`. + public var _type: Components.Schemas.RepositoryRuleParamsReviewer._TypePayload + /// Creates a new `RepositoryRuleParamsReviewer`. + /// + /// - Parameters: + /// - id: ID of the reviewer which must review changes to matching files. + /// - _type: The type of the reviewer + public init( + id: Swift.Int, + _type: Components.Schemas.RepositoryRuleParamsReviewer._TypePayload + ) { + self.id = id + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + } + } + /// A reviewing team, and file patterns describing which files they must approve changes to. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-required-reviewer-configuration`. + public struct RepositoryRuleParamsRequiredReviewerConfiguration: Codable, Hashable, Sendable { + /// Array of file patterns. Pull requests which change matching files must be approved by the specified team. File patterns use fnmatch syntax. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-required-reviewer-configuration/file_patterns`. + public var filePatterns: [Swift.String] + /// Minimum number of approvals required from the specified team. If set to zero, the team will be added to the pull request but approval is optional. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-required-reviewer-configuration/minimum_approvals`. + public var minimumApprovals: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository-rule-params-required-reviewer-configuration/reviewer`. + public var reviewer: Components.Schemas.RepositoryRuleParamsReviewer + /// Creates a new `RepositoryRuleParamsRequiredReviewerConfiguration`. + /// + /// - Parameters: + /// - filePatterns: Array of file patterns. Pull requests which change matching files must be approved by the specified team. File patterns use fnmatch syntax. + /// - minimumApprovals: Minimum number of approvals required from the specified team. If set to zero, the team will be added to the pull request but approval is optional. + /// - reviewer: + public init( + filePatterns: [Swift.String], + minimumApprovals: Swift.Int, + reviewer: Components.Schemas.RepositoryRuleParamsReviewer + ) { + self.filePatterns = filePatterns + self.minimumApprovals = minimumApprovals + self.reviewer = reviewer + } + public enum CodingKeys: String, CodingKey { + case filePatterns = "file_patterns" + case minimumApprovals = "minimum_approvals" + case reviewer + } + } /// Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request`. @@ -12687,10 +13171,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. public var allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? - /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. - public var automaticCopilotCodeReviewEnabled: Swift.Bool? /// New, reviewable commits pushed will dismiss previous pull request review approvals. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismiss_stale_reviews_on_push`. @@ -12711,41 +13191,48 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_review_thread_resolution`. public var requiredReviewThreadResolution: Swift.Bool + /// > [!NOTE] + /// > `required_reviewers` is in beta and subject to change. + /// + /// A collection of reviewers and associated file patterns. Each reviewer has a list of file patterns which determine the files that reviewer is required to review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_reviewers`. + public var requiredReviewers: [Components.Schemas.RepositoryRuleParamsRequiredReviewerConfiguration]? /// Creates a new `ParametersPayload`. /// /// - Parameters: /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - automaticCopilotCodeReviewEnabled: Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. /// - requiredApprovingReviewCount: The number of approving reviews that are required before a pull request can be merged. /// - requiredReviewThreadResolution: All conversations on code must be resolved before a pull request can be merged. + /// - requiredReviewers: > [!NOTE] public init( allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? = nil, - automaticCopilotCodeReviewEnabled: Swift.Bool? = nil, dismissStaleReviewsOnPush: Swift.Bool, requireCodeOwnerReview: Swift.Bool, requireLastPushApproval: Swift.Bool, requiredApprovingReviewCount: Swift.Int, - requiredReviewThreadResolution: Swift.Bool + requiredReviewThreadResolution: Swift.Bool, + requiredReviewers: [Components.Schemas.RepositoryRuleParamsRequiredReviewerConfiguration]? = nil ) { self.allowedMergeMethods = allowedMergeMethods - self.automaticCopilotCodeReviewEnabled = automaticCopilotCodeReviewEnabled self.dismissStaleReviewsOnPush = dismissStaleReviewsOnPush self.requireCodeOwnerReview = requireCodeOwnerReview self.requireLastPushApproval = requireLastPushApproval self.requiredApprovingReviewCount = requiredApprovingReviewCount self.requiredReviewThreadResolution = requiredReviewThreadResolution + self.requiredReviewers = requiredReviewers } public enum CodingKeys: String, CodingKey { case allowedMergeMethods = "allowed_merge_methods" - case automaticCopilotCodeReviewEnabled = "automatic_copilot_code_review_enabled" case dismissStaleReviewsOnPush = "dismiss_stale_reviews_on_push" case requireCodeOwnerReview = "require_code_owner_review" case requireLastPushApproval = "require_last_push_approval" case requiredApprovingReviewCount = "required_approving_review_count" case requiredReviewThreadResolution = "required_review_thread_resolution" + case requiredReviewers = "required_reviewers" } } /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. @@ -12893,7 +13380,7 @@ public enum Components { public var _type: Components.Schemas.RepositoryRuleCommitMessagePattern._TypePayload /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. + /// How this rule appears when configuring it. /// /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/name`. public var name: Swift.String? @@ -12921,7 +13408,7 @@ public enum Components { /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. + /// - name: How this rule appears when configuring it. /// - negate: If true, the rule will fail if the pattern matches. /// - _operator: The operator to use for matching. /// - pattern: The pattern to match with. @@ -12974,7 +13461,7 @@ public enum Components { public var _type: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern._TypePayload /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. + /// How this rule appears when configuring it. /// /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/name`. public var name: Swift.String? @@ -13002,7 +13489,7 @@ public enum Components { /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. + /// - name: How this rule appears when configuring it. /// - negate: If true, the rule will fail if the pattern matches. /// - _operator: The operator to use for matching. /// - pattern: The pattern to match with. @@ -13055,7 +13542,7 @@ public enum Components { public var _type: Components.Schemas.RepositoryRuleCommitterEmailPattern._TypePayload /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. + /// How this rule appears when configuring it. /// /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/name`. public var name: Swift.String? @@ -13083,7 +13570,7 @@ public enum Components { /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. + /// - name: How this rule appears when configuring it. /// - negate: If true, the rule will fail if the pattern matches. /// - _operator: The operator to use for matching. /// - pattern: The pattern to match with. @@ -13136,7 +13623,7 @@ public enum Components { public var _type: Components.Schemas.RepositoryRuleBranchNamePattern._TypePayload /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. + /// How this rule appears when configuring it. /// /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/name`. public var name: Swift.String? @@ -13164,7 +13651,7 @@ public enum Components { /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. + /// - name: How this rule appears when configuring it. /// - negate: If true, the rule will fail if the pattern matches. /// - _operator: The operator to use for matching. /// - pattern: The pattern to match with. @@ -13217,7 +13704,7 @@ public enum Components { public var _type: Components.Schemas.RepositoryRuleTagNamePattern._TypePayload /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. + /// How this rule appears when configuring it. /// /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/name`. public var name: Swift.String? @@ -13245,7 +13732,7 @@ public enum Components { /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. + /// - name: How this rule appears when configuring it. /// - negate: If true, the rule will fail if the pattern matches. /// - _operator: The operator to use for matching. /// - pattern: The pattern to match with. @@ -13673,7 +14160,7 @@ public enum Components { case parameters } } - /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review and their premium requests quota has not reached the limit. /// /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review`. public struct RepositoryRuleCopilotCodeReview: Codable, Hashable, Sendable { @@ -13777,8 +14264,8 @@ public enum Components { case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) /// - Remark: Generated from `#/components/schemas/repository-rule/case22`. case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .RepositoryRuleCreation(try .init(from: decoder)) return @@ -13917,7 +14404,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .RepositoryRuleCreation(value): try value.encode(to: encoder) @@ -14107,8 +14594,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -14129,7 +14616,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -14251,8 +14738,10 @@ public enum Components { case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) /// - Remark: Generated from `#/components/schemas/org-rules/case20`. case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + /// - Remark: Generated from `#/components/schemas/org-rules/case21`. + case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .RepositoryRuleCreation(try .init(from: decoder)) return @@ -14373,13 +14862,19 @@ public enum Components { } catch { errors.append(error) } + do { + self = .RepositoryRuleCopilotCodeReview(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .RepositoryRuleCreation(value): try value.encode(to: encoder) @@ -14421,6 +14916,8 @@ public enum Components { try value.encode(to: encoder) case let .RepositoryRuleCodeScanning(value): try value.encode(to: encoder) + case let .RepositoryRuleCopilotCodeReview(value): + try value.encode(to: encoder) } } } @@ -14862,11 +15359,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -14913,10 +15410,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -14924,8 +15421,8 @@ public enum Components { case case1(Components.Schemas.Deployment.PayloadPayload.Case1Payload) /// - Remark: Generated from `#/components/schemas/deployment/payload/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -14944,7 +15441,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -16255,7 +16752,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. public var email: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? + public var date: Foundation.Date? /// Creates a new `NullableGitUser`. /// /// - Parameters: @@ -16265,7 +16762,7 @@ public enum Components { public init( name: Swift.String? = nil, email: Swift.String? = nil, - date: Swift.String? = nil + date: Foundation.Date? = nil ) { self.name = name self.email = email @@ -16505,8 +17002,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/commit/author/case2`. case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -16525,7 +17022,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -16542,8 +17039,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -16562,7 +17059,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -17032,7 +17529,7 @@ public enum Components { case url case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.url = try container.decode( Swift.String.self, @@ -17064,7 +17561,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decode( Swift.Bool.self, @@ -17091,7 +17588,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decode( Swift.Bool.self, @@ -17118,7 +17615,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decode( Swift.Bool.self, @@ -17147,7 +17644,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decodeIfPresent( Swift.Bool.self, @@ -17174,7 +17671,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decode( Swift.Bool.self, @@ -17203,7 +17700,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decodeIfPresent( Swift.Bool.self, @@ -17234,7 +17731,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case enabled } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.enabled = try container.decodeIfPresent( Swift.Bool.self, @@ -20066,8 +20563,8 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -20088,7 +20585,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -20197,8 +20694,8 @@ public enum Components { self.value2 = value2 self.value3 = value3 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -20225,7 +20722,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) try self.value3?.encode(to: encoder) @@ -20728,10 +21225,10 @@ public enum Components { public init(additionalProperties: [String: Swift.Int] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -21088,8 +21585,8 @@ public enum Components { case case1(Swift.Int) /// - Remark: Generated from `#/components/schemas/page-deployment/id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -21108,7 +21605,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -21574,289 +22071,6 @@ public enum Components { case altDomain = "alt_domain" } } - /// Data related to a release. - /// - /// - Remark: Generated from `#/components/schemas/release-asset`. - public struct ReleaseAsset: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/release-asset/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/release-asset/browser_download_url`. - public var browserDownloadUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/release-asset/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/release-asset/node_id`. - public var nodeId: Swift.String - /// The file name of the asset. - /// - /// - Remark: Generated from `#/components/schemas/release-asset/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/release-asset/label`. - public var label: Swift.String? - /// State of the release asset. - /// - /// - Remark: Generated from `#/components/schemas/release-asset/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case uploaded = "uploaded" - case open = "open" - } - /// State of the release asset. - /// - /// - Remark: Generated from `#/components/schemas/release-asset/state`. - public var state: Components.Schemas.ReleaseAsset.StatePayload - /// - Remark: Generated from `#/components/schemas/release-asset/content_type`. - public var contentType: Swift.String - /// - Remark: Generated from `#/components/schemas/release-asset/size`. - public var size: Swift.Int - /// - Remark: Generated from `#/components/schemas/release-asset/digest`. - public var digest: Swift.String? - /// - Remark: Generated from `#/components/schemas/release-asset/download_count`. - public var downloadCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/release-asset/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/release-asset/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/release-asset/uploader`. - public var uploader: Components.Schemas.NullableSimpleUser? - /// Creates a new `ReleaseAsset`. - /// - /// - Parameters: - /// - url: - /// - browserDownloadUrl: - /// - id: - /// - nodeId: - /// - name: The file name of the asset. - /// - label: - /// - state: State of the release asset. - /// - contentType: - /// - size: - /// - digest: - /// - downloadCount: - /// - createdAt: - /// - updatedAt: - /// - uploader: - public init( - url: Swift.String, - browserDownloadUrl: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - name: Swift.String, - label: Swift.String? = nil, - state: Components.Schemas.ReleaseAsset.StatePayload, - contentType: Swift.String, - size: Swift.Int, - digest: Swift.String? = nil, - downloadCount: Swift.Int, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - uploader: Components.Schemas.NullableSimpleUser? = nil - ) { - self.url = url - self.browserDownloadUrl = browserDownloadUrl - self.id = id - self.nodeId = nodeId - self.name = name - self.label = label - self.state = state - self.contentType = contentType - self.size = size - self.digest = digest - self.downloadCount = downloadCount - self.createdAt = createdAt - self.updatedAt = updatedAt - self.uploader = uploader - } - public enum CodingKeys: String, CodingKey { - case url - case browserDownloadUrl = "browser_download_url" - case id - case nodeId = "node_id" - case name - case label - case state - case contentType = "content_type" - case size - case digest - case downloadCount = "download_count" - case createdAt = "created_at" - case updatedAt = "updated_at" - case uploader - } - } - /// A release. - /// - /// - Remark: Generated from `#/components/schemas/release`. - public struct Release: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/release/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/release/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/release/assets_url`. - public var assetsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/release/upload_url`. - public var uploadUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/release/tarball_url`. - public var tarballUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/zipball_url`. - public var zipballUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/release/node_id`. - public var nodeId: Swift.String - /// The name of the tag. - /// - /// - Remark: Generated from `#/components/schemas/release/tag_name`. - public var tagName: Swift.String - /// Specifies the commitish value that determines where the Git tag is created from. - /// - /// - Remark: Generated from `#/components/schemas/release/target_commitish`. - public var targetCommitish: Swift.String - /// - Remark: Generated from `#/components/schemas/release/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/body`. - public var body: Swift.String? - /// true to create a draft (unpublished) release, false to create a published one. - /// - /// - Remark: Generated from `#/components/schemas/release/draft`. - public var draft: Swift.Bool - /// Whether to identify the release as a prerelease or a full release. - /// - /// - Remark: Generated from `#/components/schemas/release/prerelease`. - public var prerelease: Swift.Bool - /// Whether or not the release is immutable. - /// - /// - Remark: Generated from `#/components/schemas/release/immutable`. - public var immutable: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/release/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/release/published_at`. - public var publishedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/release/updated_at`. - public var updatedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/release/author`. - public var author: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/release/assets`. - public var assets: [Components.Schemas.ReleaseAsset] - /// - Remark: Generated from `#/components/schemas/release/body_html`. - public var bodyHtml: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/body_text`. - public var bodyText: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/mentions_count`. - public var mentionsCount: Swift.Int? - /// The URL of the release discussion. - /// - /// - Remark: Generated from `#/components/schemas/release/discussion_url`. - public var discussionUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/release/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// Creates a new `Release`. - /// - /// - Parameters: - /// - url: - /// - htmlUrl: - /// - assetsUrl: - /// - uploadUrl: - /// - tarballUrl: - /// - zipballUrl: - /// - id: - /// - nodeId: - /// - tagName: The name of the tag. - /// - targetCommitish: Specifies the commitish value that determines where the Git tag is created from. - /// - name: - /// - body: - /// - draft: true to create a draft (unpublished) release, false to create a published one. - /// - prerelease: Whether to identify the release as a prerelease or a full release. - /// - immutable: Whether or not the release is immutable. - /// - createdAt: - /// - publishedAt: - /// - updatedAt: - /// - author: - /// - assets: - /// - bodyHtml: - /// - bodyText: - /// - mentionsCount: - /// - discussionUrl: The URL of the release discussion. - /// - reactions: - public init( - url: Swift.String, - htmlUrl: Swift.String, - assetsUrl: Swift.String, - uploadUrl: Swift.String, - tarballUrl: Swift.String? = nil, - zipballUrl: Swift.String? = nil, - id: Swift.Int, - nodeId: Swift.String, - tagName: Swift.String, - targetCommitish: Swift.String, - name: Swift.String? = nil, - body: Swift.String? = nil, - draft: Swift.Bool, - prerelease: Swift.Bool, - immutable: Swift.Bool? = nil, - createdAt: Foundation.Date, - publishedAt: Foundation.Date? = nil, - updatedAt: Foundation.Date? = nil, - author: Components.Schemas.SimpleUser, - assets: [Components.Schemas.ReleaseAsset], - bodyHtml: Swift.String? = nil, - bodyText: Swift.String? = nil, - mentionsCount: Swift.Int? = nil, - discussionUrl: Swift.String? = nil, - reactions: Components.Schemas.ReactionRollup? = nil - ) { - self.url = url - self.htmlUrl = htmlUrl - self.assetsUrl = assetsUrl - self.uploadUrl = uploadUrl - self.tarballUrl = tarballUrl - self.zipballUrl = zipballUrl - self.id = id - self.nodeId = nodeId - self.tagName = tagName - self.targetCommitish = targetCommitish - self.name = name - self.body = body - self.draft = draft - self.prerelease = prerelease - self.immutable = immutable - self.createdAt = createdAt - self.publishedAt = publishedAt - self.updatedAt = updatedAt - self.author = author - self.assets = assets - self.bodyHtml = bodyHtml - self.bodyText = bodyText - self.mentionsCount = mentionsCount - self.discussionUrl = discussionUrl - self.reactions = reactions - } - public enum CodingKeys: String, CodingKey { - case url - case htmlUrl = "html_url" - case assetsUrl = "assets_url" - case uploadUrl = "upload_url" - case tarballUrl = "tarball_url" - case zipballUrl = "zipball_url" - case id - case nodeId = "node_id" - case tagName = "tag_name" - case targetCommitish = "target_commitish" - case name - case body - case draft - case prerelease - case immutable - case createdAt = "created_at" - case publishedAt = "published_at" - case updatedAt = "updated_at" - case author - case assets - case bodyHtml = "body_html" - case bodyText = "body_text" - case mentionsCount = "mentions_count" - case discussionUrl = "discussion_url" - case reactions - } - } /// Generated name and body describing a release /// /// - Remark: Generated from `#/components/schemas/release-notes-content`. @@ -21952,11 +22166,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -21981,11 +22195,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22010,11 +22224,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22039,11 +22253,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22068,11 +22282,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22097,11 +22311,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22126,11 +22340,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22155,11 +22369,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22184,11 +22398,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22213,11 +22427,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22242,11 +22456,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22271,11 +22485,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22300,11 +22514,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22329,11 +22543,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22358,11 +22572,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22387,11 +22601,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22416,11 +22630,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22445,11 +22659,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22474,11 +22688,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22503,11 +22717,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22532,11 +22746,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -22561,19 +22775,19 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. case case22(Components.Schemas.RepositoryRuleDetailed.Case22Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -22712,7 +22926,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -22953,49 +23167,6 @@ public enum Components { case nodeId = "node_id" } } - /// Tag protection - /// - /// - Remark: Generated from `#/components/schemas/tag-protection`. - public struct TagProtection: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/tag-protection/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/tag-protection/created_at`. - public var createdAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/tag-protection/updated_at`. - public var updatedAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/tag-protection/enabled`. - public var enabled: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/tag-protection/pattern`. - public var pattern: Swift.String - /// Creates a new `TagProtection`. - /// - /// - Parameters: - /// - id: - /// - createdAt: - /// - updatedAt: - /// - enabled: - /// - pattern: - public init( - id: Swift.Int? = nil, - createdAt: Swift.String? = nil, - updatedAt: Swift.String? = nil, - enabled: Swift.Bool? = nil, - pattern: Swift.String - ) { - self.id = id - self.createdAt = createdAt - self.updatedAt = updatedAt - self.enabled = enabled - self.pattern = pattern - } - public enum CodingKeys: String, CodingKey { - case id - case createdAt = "created_at" - case updatedAt = "updated_at" - case enabled - case pattern - } - } /// A topic aggregates entities that are related to a subject. /// /// - Remark: Generated from `#/components/schemas/topic`. @@ -23322,8 +23493,8 @@ public enum Components { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/pages-deployment-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -23342,7 +23513,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -23359,10 +23530,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/release-id`. public typealias ReleaseId = Swift.Int - /// The unique identifier of the tag protection. - /// - /// - Remark: Generated from `#/components/parameters/tag-protection-id`. - public typealias TagProtectionId = Swift.Int /// The time frame to display results for. /// /// - Remark: Generated from `#/components/parameters/per`. @@ -24246,10 +24413,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -24946,6 +25113,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/post(repos/create-org-ruleset)/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 + ) + } + } + } /// Internal Error /// /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/post(repos/create-org-ruleset)/responses/500`. @@ -25844,6 +26034,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/put(repos/update-org-ruleset)/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 + ) + } + } + } /// Internal Error /// /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/put(repos/update-org-ruleset)/responses/500`. @@ -26517,6 +26730,119 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_non_provider_patterns`. public var secretScanningNonProviderPatterns: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningNonProviderPatternsPayload? + /// Use the `status` property to enable or disable secret scanning delegated alert dismissal for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// Can be `enabled` or `disabled`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Swift.String? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: Can be `enabled` or `disabled`. + public init(status: Swift.String? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Use the `status` property to enable or disable secret scanning delegated alert dismissal for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedAlertDismissalPayload? + /// Use the `status` property to enable or disable secret scanning delegated bypass for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// Can be `enabled` or `disabled`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass/status`. + public var status: Swift.String? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: Can be `enabled` or `disabled`. + public init(status: Swift.String? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Use the `status` property to enable or disable secret scanning delegated bypass for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassPayload? + /// Feature options for secret scanning delegated bypass. + /// This object is only honored when `security_and_analysis.secret_scanning_delegated_bypass.status` is set to `enabled`. + /// You can send this object in the same request as `secret_scanning_delegated_bypass`, or update just the options in a separate request. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass. + /// If you omit this field, the existing set of reviewers is unchanged. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass. + /// If you omit this field, the existing set of reviewers is unchanged. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass. + public init(reviewers: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// Feature options for secret scanning delegated bypass. + /// This object is only honored when `security_and_analysis.secret_scanning_delegated_bypass.status` is set to `enabled`. + /// You can send this object in the same request as `secret_scanning_delegated_bypass`, or update just the options in a separate request. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysisPayload`. /// /// - Parameters: @@ -26526,13 +26852,19 @@ public enum Operations { /// - secretScanningPushProtection: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." /// - secretScanningAiDetection: Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." /// - secretScanningNonProviderPatterns: Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + /// - secretScanningDelegatedAlertDismissal: Use the `status` property to enable or disable secret scanning delegated alert dismissal for this repository. + /// - secretScanningDelegatedBypass: Use the `status` property to enable or disable secret scanning delegated bypass for this repository. + /// - secretScanningDelegatedBypassOptions: Feature options for secret scanning delegated bypass. public init( advancedSecurity: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.AdvancedSecurityPayload? = nil, codeSecurity: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.CodeSecurityPayload? = nil, secretScanning: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningPushProtectionPayload? = nil, secretScanningAiDetection: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningAiDetectionPayload? = nil, - secretScanningNonProviderPatterns: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningNonProviderPatternsPayload? = nil + secretScanningNonProviderPatterns: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningNonProviderPatternsPayload? = nil, + secretScanningDelegatedAlertDismissal: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -26540,6 +26872,9 @@ public enum Operations { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningAiDetection = secretScanningAiDetection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -26548,6 +26883,9 @@ public enum Operations { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningAiDetection = "secret_scanning_ai_detection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Specify which security and analysis features to enable or disable for the repository. @@ -27635,10 +27973,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -27655,10 +27993,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -28005,10 +28343,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -28025,10 +28363,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -32903,8 +33241,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts/POST/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -32923,7 +33261,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -33183,8 +33521,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts/PUT/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -33203,7 +33541,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -33440,8 +33778,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts/DELETE/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -33460,7 +33798,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -34910,8 +35248,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams/POST/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -34930,7 +35268,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -35146,8 +35484,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams/PUT/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -35166,7 +35504,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -35382,8 +35720,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams/DELETE/requestBody/json/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -35402,7 +35740,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -41101,20 +41439,29 @@ public enum Operations { } } public var headers: Operations.ReposGetContent.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/requestBody/content/application\/json`. + case json(OpenAPIRuntime.OpenAPIValueContainer) + } + public var body: Operations.ReposGetContent.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - query: /// - headers: + /// - body: public init( path: Operations.ReposGetContent.Input.Path, query: Operations.ReposGetContent.Input.Query = .init(), - headers: Operations.ReposGetContent.Input.Headers = .init() + headers: Operations.ReposGetContent.Input.Headers = .init(), + body: Operations.ReposGetContent.Input.Body? = nil ) { self.path = path self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -41680,8 +42027,8 @@ public enum Operations { case BasicError(Components.Schemas.BasicError) /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/PUT/responses/409/content/json/case2`. case RepositoryRuleViolationError(Components.Schemas.RepositoryRuleViolationError) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .BasicError(try .init(from: decoder)) return @@ -41700,7 +42047,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .BasicError(value): try value.encode(to: encoder) @@ -42772,10 +43119,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -42785,8 +43132,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/deployments/POST/requestBody/json/payload/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -42805,7 +43152,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -44210,10 +44557,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -44848,7 +45195,7 @@ public enum Operations { case reviewers case deploymentBranchPolicy = "deployment_branch_policy" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.waitTimer = try container.decodeIfPresent( Components.Schemas.WaitTimer.self, @@ -47656,7 +48003,7 @@ public enum Operations { case events case active } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decodeIfPresent( Swift.String.self, @@ -48693,7 +49040,7 @@ public enum Operations { case secret case insecureSsl = "insecure_ssl" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.url = try container.decodeIfPresent( Components.Schemas.WebhookConfigUrl.self, @@ -52308,8 +52655,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -52330,7 +52677,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -52593,8 +52940,8 @@ public enum Operations { self.value4 = value4 self.value5 = value5 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -52633,7 +52980,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) try self.value3?.encode(to: encoder) @@ -53931,8 +54278,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/pages-deployment-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -53951,7 +54298,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -54139,8 +54486,8 @@ public enum Operations { case case1(Swift.Int) /// - Remark: Generated from `#/components/parameters/pages-deployment-id/case2`. case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -54159,7 +54506,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -59121,6 +59468,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/post(repos/create-repo-ruleset)/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 + ) + } + } + } /// Internal Error /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/post(repos/create-repo-ruleset)/responses/500`. @@ -60059,6 +60429,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/put(repos/update-repo-ruleset)/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 + ) + } + } + } /// Internal Error /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/put(repos/update-repo-ruleset)/responses/500`. @@ -62108,597 +62501,6 @@ public enum Operations { } } } - /// Closing down - List tag protection states for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. - /// - /// This returns the tag protection states of a repository. - /// - /// This information is only available to repository administrators. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)`. - public enum ReposListTagProtection { - public static let id: Swift.String = "repos/list-tag-protection" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.owner = owner - self.repo = repo - } - } - public var path: Operations.ReposListTagProtection.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReposListTagProtection.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ReposListTagProtection.Input.Path, - headers: Operations.ReposListTagProtection.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TagProtection]) - /// 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.TagProtection] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReposListTagProtection.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReposListTagProtection.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ReposListTagProtection.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.ReposListTagProtection.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Closing down - Create a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. - /// - /// This creates a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/tags/protection`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)`. - public enum ReposCreateTagProtection { - public static let id: Swift.String = "repos/create-tag-protection" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.owner = owner - self.repo = repo - } - } - public var path: Operations.ReposCreateTagProtection.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReposCreateTagProtection.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// An optional glob pattern to match against when enforcing tag protection. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/requestBody/json/pattern`. - public var pattern: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - pattern: An optional glob pattern to match against when enforcing tag protection. - public init(pattern: Swift.String) { - self.pattern = pattern - } - public enum CodingKeys: String, CodingKey { - case pattern - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/requestBody/content/application\/json`. - case json(Operations.ReposCreateTagProtection.Input.Body.JsonPayload) - } - public var body: Operations.ReposCreateTagProtection.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ReposCreateTagProtection.Input.Path, - headers: Operations.ReposCreateTagProtection.Input.Headers = .init(), - body: Operations.ReposCreateTagProtection.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/POST/responses/201/content/application\/json`. - case json(Components.Schemas.TagProtection) - /// 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.TagProtection { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ReposCreateTagProtection.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ReposCreateTagProtection.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ReposCreateTagProtection.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ReposCreateTagProtection.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Closing down - Delete a tag protection state for a repository - /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. - /// - /// This deletes a tag protection state for a repository. - /// This endpoint is only available to repository administrators. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)`. - public enum ReposDeleteTagProtection { - public static let id: Swift.String = "repos/delete-tag-protection" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/{tag_protection_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/{tag_protection_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/{tag_protection_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the tag protection. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/{tag_protection_id}/DELETE/path/tag_protection_id`. - public var tagProtectionId: Components.Parameters.TagProtectionId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - tagProtectionId: The unique identifier of the tag protection. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - tagProtectionId: Components.Parameters.TagProtectionId - ) { - self.owner = owner - self.repo = repo - self.tagProtectionId = tagProtectionId - } - } - public var path: Operations.ReposDeleteTagProtection.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/tags/protection/{tag_protection_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ReposDeleteTagProtection.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ReposDeleteTagProtection.Input.Path, - headers: Operations.ReposDeleteTagProtection.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ReposDeleteTagProtection.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)/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.ReposDeleteTagProtection.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/{tag_protection_id}/delete(repos/delete-tag-protection)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } /// Download a repository archive (tar) /// /// Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually From 6488a8173df9150efc9b268f3e1bc4144859590b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:14:16 +0000 Subject: [PATCH 21/33] Commit via running: make Sources/search --- Sources/search/Types.swift | 370 +++++++++++++++++++++++++++++++++++-- 1 file changed, 354 insertions(+), 16 deletions(-) diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 3b97263dce..0b8c3f8a2a 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -631,8 +631,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -657,7 +657,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1130,6 +1130,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1375,6 +1394,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1472,6 +1494,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1569,6 +1594,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -1667,6 +1695,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -1972,8 +2003,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -1992,7 +2023,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -2064,7 +2095,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -2094,7 +2125,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -2309,6 +2340,140 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// Context around who pinned an issue comment and when it was pinned. + /// + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment`. + public struct NullablePinnedIssueComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_at`. + public var pinnedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_by`. + public var pinnedBy: Components.Schemas.NullableSimpleUser? + /// Creates a new `NullablePinnedIssueComment`. + /// + /// - Parameters: + /// - pinnedAt: + /// - pinnedBy: + public init( + pinnedAt: Foundation.Date, + pinnedBy: Components.Schemas.NullableSimpleUser? = nil + ) { + self.pinnedAt = pinnedAt + self.pinnedBy = pinnedBy + } + public enum CodingKeys: String, CodingKey { + case pinnedAt = "pinned_at" + case pinnedBy = "pinned_by" + } + } + /// Comments provide a way for people to collaborate on an issue. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment`. + public struct NullableIssueComment: Codable, Hashable, Sendable { + /// Unique identifier of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/node_id`. + public var nodeId: Swift.String + /// URL for the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/url`. + public var url: Swift.String + /// Contents of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? + /// Creates a new `NullableIssueComment`. + /// + /// - Parameters: + /// - id: Unique identifier of the issue comment + /// - nodeId: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment + /// - bodyText: + /// - bodyHtml: + /// - htmlUrl: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - issueUrl: + /// - authorAssociation: + /// - performedViaGithubApp: + /// - reactions: + /// - pin: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + bodyText: Swift.String? = nil, + bodyHtml: Swift.String? = nil, + htmlUrl: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + issueUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.body = body + self.bodyText = bodyText + self.bodyHtml = bodyHtml + self.htmlUrl = htmlUrl + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + self.issueUrl = issueUrl + self.authorAssociation = authorAssociation + self.performedViaGithubApp = performedViaGithubApp + self.reactions = reactions + self.pin = pin + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case body + case bodyText = "body_text" + case bodyHtml = "body_html" + case htmlUrl = "html_url" + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + case issueUrl = "issue_url" + case authorAssociation = "author_association" + case performedViaGithubApp = "performed_via_github_app" + case reactions + case pin + } + } /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. public struct IssueDependenciesSummary: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. @@ -2392,8 +2557,8 @@ public enum Components { self.value2 = value2 self.value3 = value3 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -2420,7 +2585,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2, @@ -2676,6 +2841,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2686,6 +2952,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2693,7 +2962,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2702,6 +2974,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2711,6 +2986,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -2853,6 +3131,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2988,10 +3281,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3069,6 +3362,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3158,6 +3454,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3247,6 +3546,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3337,6 +3639,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3369,7 +3674,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. public var email: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? + public var date: Foundation.Date? /// Creates a new `NullableGitUser`. /// /// - Parameters: @@ -3379,7 +3684,7 @@ public enum Components { public init( name: Swift.String? = nil, email: Swift.String? = nil, - date: Swift.String? = nil + date: Foundation.Date? = nil ) { self.name = name self.email = email @@ -3988,6 +4293,8 @@ public enum Components { public var _type: Components.Schemas.IssueType? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/pinned_comment`. + public var pinnedComment: Components.Schemas.NullableIssueComment? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// Creates a new `IssueSearchResultItem`. @@ -4031,6 +4338,7 @@ public enum Components { /// - timelineUrl: /// - _type: /// - performedViaGithubApp: + /// - pinnedComment: /// - reactions: public init( url: Swift.String, @@ -4071,6 +4379,7 @@ public enum Components { timelineUrl: Swift.String? = nil, _type: Components.Schemas.IssueType? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + pinnedComment: Components.Schemas.NullableIssueComment? = nil, reactions: Components.Schemas.ReactionRollup? = nil ) { self.url = url @@ -4111,6 +4420,7 @@ public enum Components { self.timelineUrl = timelineUrl self._type = _type self.performedViaGithubApp = performedViaGithubApp + self.pinnedComment = pinnedComment self.reactions = reactions } public enum CodingKeys: String, CodingKey { @@ -4152,6 +4462,7 @@ public enum Components { case timelineUrl = "timeline_url" case _type = "type" case performedViaGithubApp = "performed_via_github_app" + case pinnedComment = "pinned_comment" case reactions } } @@ -4374,6 +4685,21 @@ public enum Components { public var hasDownloads: Swift.Bool /// - Remark: Generated from `#/components/schemas/repo-search-result-item/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repo-search-result-item/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repo-search-result-item/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repo-search-result-item/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.RepoSearchResultItem.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/repo-search-result-item/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/repo-search-result-item/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -4526,6 +4852,9 @@ public enum Components { /// - hasWiki: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4616,6 +4945,9 @@ public enum Components { hasWiki: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.RepoSearchResultItem.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4706,6 +5038,9 @@ public enum Components { self.hasWiki = hasWiki self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4797,6 +5132,9 @@ public enum Components { case hasWiki = "has_wiki" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 92a6f36d5bb991758e4d3dbcc174813d4e229063 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:14:38 +0000 Subject: [PATCH 22/33] Commit via running: make Sources/secret-scanning --- Sources/secret-scanning/Client.swift | 16 ++++ Sources/secret-scanning/Types.swift | 118 +++++++++++++++++++-------- 2 files changed, 98 insertions(+), 36 deletions(-) diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index da7e340d4d..dd4d2e79d2 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -85,6 +85,13 @@ public struct Client: APIProtocol { name: "resolution", value: input.query.resolution ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -601,6 +608,13 @@ public struct Client: APIProtocol { name: "resolution", value: input.query.resolution ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -844,6 +858,8 @@ public struct Client: APIProtocol { /// /// Updates the status of a secret scanning alert in an eligible repository. /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index aca48a2859..e370e69ad7 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -66,6 +66,8 @@ public protocol APIProtocol: Sendable { /// /// Updates the status of a secret scanning alert in an eligible repository. /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. @@ -214,6 +216,8 @@ extension APIProtocol { /// /// Updates the status of a secret scanning alert in an eligible repository. /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. @@ -577,8 +581,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -603,7 +607,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1644,8 +1648,8 @@ public enum Components { case SecretScanningLocationPullRequestReview(Components.Schemas.SecretScanningLocationPullRequestReview) /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case13`. case SecretScanningLocationPullRequestReviewComment(Components.Schemas.SecretScanningLocationPullRequestReviewComment) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SecretScanningLocationCommit(try .init(from: decoder)) return @@ -1730,7 +1734,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SecretScanningLocationCommit(value): try value.encode(to: encoder) @@ -2380,10 +2384,6 @@ public enum Components { case assignedTo = "assigned_to" } } - /// An optional comment when closing or reopening an alert. Cannot be updated or deleted. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-resolution-comment`. - public typealias SecretScanningAlertResolutionComment = Swift.String /// - Remark: Generated from `#/components/schemas/secret-scanning-location`. public struct SecretScanningLocation: Codable, Hashable, Sendable { /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. @@ -2436,8 +2436,8 @@ public enum Components { case SecretScanningLocationPullRequestReview(Components.Schemas.SecretScanningLocationPullRequestReview) /// - Remark: Generated from `#/components/schemas/secret-scanning-location/details/case13`. case SecretScanningLocationPullRequestReviewComment(Components.Schemas.SecretScanningLocationPullRequestReviewComment) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SecretScanningLocationCommit(try .init(from: decoder)) return @@ -2522,7 +2522,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SecretScanningLocationCommit(value): try value.encode(to: encoder) @@ -2711,11 +2711,11 @@ public enum Components { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) self.value2 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) try self.value2.encode(to: encoder) } @@ -2794,6 +2794,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-resolution`. public typealias SecretScanningAlertResolution = Swift.String + /// Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-assignee`. + public typealias SecretScanningAlertAssignee = Swift.String /// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. @@ -3116,6 +3120,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/resolution`. public var resolution: Components.Parameters.SecretScanningAlertResolution? + /// Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.SecretScanningAlertAssignee? /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { case created = "created" @@ -3172,6 +3180,7 @@ public enum Operations { /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. /// - secretType: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + /// - assignee: Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. /// - 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)." @@ -3186,6 +3195,7 @@ public enum Operations { state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, resolution: Components.Parameters.SecretScanningAlertResolution? = nil, + assignee: Components.Parameters.SecretScanningAlertAssignee? = nil, sort: Components.Parameters.SecretScanningAlertSort? = nil, direction: Components.Parameters.Direction? = nil, page: Components.Parameters.Page? = nil, @@ -3200,6 +3210,7 @@ public enum Operations { self.state = state self.secretType = secretType self.resolution = resolution + self.assignee = assignee self.sort = sort self.direction = direction self.page = page @@ -4022,6 +4033,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/resolution`. public var resolution: Components.Parameters.SecretScanningAlertResolution? + /// Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.SecretScanningAlertAssignee? /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { case created = "created" @@ -4078,6 +4093,7 @@ public enum Operations { /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. /// - secretType: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + /// - assignee: Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. /// - 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)." @@ -4092,6 +4108,7 @@ public enum Operations { state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, resolution: Components.Parameters.SecretScanningAlertResolution? = nil, + assignee: Components.Parameters.SecretScanningAlertAssignee? = nil, sort: Components.Parameters.SecretScanningAlertSort? = nil, direction: Components.Parameters.Direction? = nil, page: Components.Parameters.Page? = nil, @@ -4106,6 +4123,7 @@ public enum Operations { self.state = state self.secretType = secretType self.resolution = resolution + self.assignee = assignee self.sort = sort self.direction = direction self.page = page @@ -4551,6 +4569,8 @@ public enum Operations { /// /// Updates the status of a secret scanning alert in an eligible repository. /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. @@ -4607,31 +4627,57 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/state`. - public var state: Components.Schemas.SecretScanningAlertState - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/resolution`. - public var resolution: Components.Schemas.SecretScanningAlertResolution? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/resolution_comment`. - public var resolutionComment: Components.Schemas.SecretScanningAlertResolutionComment? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Creates a new `Value1Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public var value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Creates a new `Value2Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public var value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - state: - /// - resolution: - /// - resolutionComment: + /// - value1: + /// - value2: public init( - state: Components.Schemas.SecretScanningAlertState, - resolution: Components.Schemas.SecretScanningAlertResolution? = nil, - resolutionComment: Components.Schemas.SecretScanningAlertResolutionComment? = nil + value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? = nil, + value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? = nil ) { - self.state = state - self.resolution = resolution - self.resolutionComment = resolutionComment + self.value1 = value1 + self.value2 = value2 } - public enum CodingKeys: String, CodingKey { - case state - case resolution - case resolutionComment = "resolution_comment" + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. @@ -4780,13 +4826,13 @@ public enum Operations { /// Creates a new `UnprocessableContent`. public init() {} } - /// State does not match the resolution or resolution comment + /// State does not match the resolution or resolution comment, or assignee does not have write access to the repository /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Operations.SecretScanningUpdateAlert.Output.UnprocessableContent) - /// State does not match the resolution or resolution comment + /// State does not match the resolution or resolution comment, or assignee does not have write access to the repository /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. /// From 94566e6161c23daec964ebd75a72c70cd544a82c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:15:01 +0000 Subject: [PATCH 23/33] Commit via running: make Sources/teams --- Sources/teams/Client.swift | 3372 +++---------- Sources/teams/Types.swift | 9797 +++++++----------------------------- 2 files changed, 2501 insertions(+), 10668 deletions(-) diff --git a/Sources/teams/Client.swift b/Sources/teams/Client.swift index 80c7e795df..538d0aa8c0 100644 --- a/Sources/teams/Client.swift +++ b/Sources/teams/Client.swift @@ -74,6 +74,13 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "team_type", + value: input.query.teamType + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -556,6 +563,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -568,24 +577,22 @@ public struct Client: APIProtocol { } ) } - /// List discussions + /// List pending team invitations /// - /// List all discussions on a team's page. + /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/get(teams/list-discussions-in-org)`. - public func teamsListDiscussionsInOrg(_ input: Operations.TeamsListDiscussionsInOrg.Input) async throws -> Operations.TeamsListDiscussionsInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)`. + public func teamsListPendingInvitationsInOrg(_ input: Operations.TeamsListPendingInvitationsInOrg.Input) async throws -> Operations.TeamsListPendingInvitationsInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsListDiscussionsInOrg.id, + forOperation: Operations.TeamsListPendingInvitationsInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions", + template: "/orgs/{}/teams/{}/invitations", parameters: [ input.path.org, input.path.teamSlug @@ -596,13 +603,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -617,13 +617,6 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "pinned", - value: input.query.pinned - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -633,13 +626,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListDiscussionsInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.TeamsListPendingInvitationsInOrg.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.TeamsListDiscussionsInOrg.Output.Ok.Body + let body: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -649,7 +642,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamDiscussion].self, + [Components.Schemas.OrganizationInvitation].self, from: responseBody, transforming: { value in .json(value) @@ -662,6 +655,8 @@ public struct Client: APIProtocol { headers: headers, body: body )) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -674,26 +669,21 @@ public struct Client: APIProtocol { } ) } - /// Create a discussion - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// List team members /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. + /// Team members will include the members of child teams. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// To list members in a team, the team must be visible to the authenticated user. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/post(teams/create-discussion-in-org)`. - public func teamsCreateDiscussionInOrg(_ input: Operations.TeamsCreateDiscussionInOrg.Input) async throws -> Operations.TeamsCreateDiscussionInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)`. + public func teamsListMembersInOrg(_ input: Operations.TeamsListMembersInOrg.Input) async throws -> Operations.TeamsListMembersInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsCreateDiscussionInOrg.id, + forOperation: Operations.TeamsListMembersInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions", + template: "/orgs/{}/teams/{}/members", parameters: [ input.path.org, input.path.teamSlug @@ -701,29 +691,46 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "role", + value: input.query.role + ) + 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 ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: + let headers: Operations.TeamsListMembersInOrg.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.TeamsCreateDiscussionInOrg.Output.Created.Body + let body: Operations.TeamsListMembersInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -733,7 +740,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamDiscussion.self, + [Components.Schemas.SimpleUser].self, from: responseBody, transforming: { value in .json(value) @@ -742,7 +749,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -755,28 +765,33 @@ public struct Client: APIProtocol { } ) } - /// Get a discussion + /// Get team membership for a user + /// + /// Team members will include the members of child teams. + /// + /// To get a user's membership with a team, the team must be visible to the authenticated user. /// - /// Get a specific discussion on a team's page. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > The response contains the `state` of the membership and the member's `role`. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/get(teams/get-discussion-in-org)`. - public func teamsGetDiscussionInOrg(_ input: Operations.TeamsGetDiscussionInOrg.Input) async throws -> Operations.TeamsGetDiscussionInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)`. + public func teamsGetMembershipForUserInOrg(_ input: Operations.TeamsGetMembershipForUserInOrg.Input) async throws -> Operations.TeamsGetMembershipForUserInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsGetDiscussionInOrg.id, + forOperation: Operations.TeamsGetMembershipForUserInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}", + template: "/orgs/{}/teams/{}/memberships/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -794,7 +809,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetDiscussionInOrg.Output.Ok.Body + let body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -804,7 +819,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamDiscussion.self, + Components.Schemas.TeamMembership.self, from: responseBody, transforming: { value in .json(value) @@ -814,6 +829,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 404: + return .notFound(.init()) default: return .undocumented( statusCode: response.status.code, @@ -826,33 +843,40 @@ public struct Client: APIProtocol { } ) } - /// Update a discussion + /// Add or update team membership for a user + /// + /// Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// + /// An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + /// + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/patch(teams/update-discussion-in-org)`. - public func teamsUpdateDiscussionInOrg(_ input: Operations.TeamsUpdateDiscussionInOrg.Input) async throws -> Operations.TeamsUpdateDiscussionInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)`. + public func teamsAddOrUpdateMembershipForUserInOrg(_ input: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input) async throws -> Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsUpdateDiscussionInOrg.id, + forOperation: Operations.TeamsAddOrUpdateMembershipForUserInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}", + template: "/orgs/{}/teams/{}/memberships/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -876,7 +900,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateDiscussionInOrg.Output.Ok.Body + let body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -886,7 +910,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamDiscussion.self, + Components.Schemas.TeamMembership.self, from: responseBody, transforming: { value in .json(value) @@ -896,6 +920,10 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 403: + return .forbidden(.init()) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -908,28 +936,31 @@ public struct Client: APIProtocol { } ) } - /// Delete a discussion + /// Remove team membership for a user + /// + /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. /// - /// Delete a discussion from a team's page. + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)`. - public func teamsDeleteDiscussionInOrg(_ input: Operations.TeamsDeleteDiscussionInOrg.Input) async throws -> Operations.TeamsDeleteDiscussionInOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)`. + public func teamsRemoveMembershipForUserInOrg(_ input: Operations.TeamsRemoveMembershipForUserInOrg.Input) async throws -> Operations.TeamsRemoveMembershipForUserInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsDeleteDiscussionInOrg.id, + forOperation: Operations.TeamsRemoveMembershipForUserInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}", + template: "/orgs/{}/teams/{}/memberships/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -943,6 +974,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 403: + return .forbidden(.init()) default: return .undocumented( statusCode: response.status.code, @@ -955,28 +988,25 @@ public struct Client: APIProtocol { } ) } - /// List discussion comments + /// List team repositories /// - /// List all comments on a team discussion. + /// Lists a team's repositories visible to the authenticated user. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-in-org)`. - public func teamsListDiscussionCommentsInOrg(_ input: Operations.TeamsListDiscussionCommentsInOrg.Input) async throws -> Operations.TeamsListDiscussionCommentsInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. + public func teamsListReposInOrg(_ input: Operations.TeamsListReposInOrg.Input) async throws -> Operations.TeamsListReposInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsListDiscussionCommentsInOrg.id, + forOperation: Operations.TeamsListReposInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments", + template: "/orgs/{}/teams/{}/repos", parameters: [ input.path.org, - input.path.teamSlug, - input.path.discussionNumber + input.path.teamSlug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -984,13 +1014,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1014,13 +1037,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListDiscussionCommentsInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.TeamsListReposInOrg.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.TeamsListDiscussionCommentsInOrg.Output.Ok.Body + let body: Operations.TeamsListReposInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1030,7 +1053,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamDiscussionComment].self, + [Components.Schemas.MinimalRepository].self, from: responseBody, transforming: { value in .json(value) @@ -1055,57 +1078,51 @@ public struct Client: APIProtocol { } ) } - /// Create a discussion comment + /// Check team permissions for a repository /// - /// Creates a new comment on a team discussion. + /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. + /// + /// If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-in-org)`. - public func teamsCreateDiscussionCommentInOrg(_ input: Operations.TeamsCreateDiscussionCommentInOrg.Input) async throws -> Operations.TeamsCreateDiscussionCommentInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)`. + public func teamsCheckPermissionsForRepoInOrg(_ input: Operations.TeamsCheckPermissionsForRepoInOrg.Input) async throws -> Operations.TeamsCheckPermissionsForRepoInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsCreateDiscussionCommentInOrg.id, + forOperation: Operations.TeamsCheckPermissionsForRepoInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments", + template: "/orgs/{}/teams/{}/repos/{}/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsCreateDiscussionCommentInOrg.Output.Created.Body + let body: Operations.TeamsCheckPermissionsForRepoInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1115,7 +1132,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamDiscussionComment.self, + Components.Schemas.TeamRepository.self, from: responseBody, transforming: { value in .json(value) @@ -1124,7 +1141,11 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) + case 204: + return .noContent(.init()) + case 404: + return .notFound(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1137,182 +1158,86 @@ public struct Client: APIProtocol { } ) } - /// Get a discussion comment + /// Add or update team repository permissions /// - /// Get a specific comment on a team discussion. + /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-in-org)`. - public func teamsGetDiscussionCommentInOrg(_ input: Operations.TeamsGetDiscussionCommentInOrg.Input) async throws -> Operations.TeamsGetDiscussionCommentInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)`. + public func teamsAddOrUpdateRepoPermissionsInOrg(_ input: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input) async throws -> Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsGetDiscussionCommentInOrg.id, + forOperation: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}", + template: "/orgs/{}/teams/{}/repos/{}/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber + input.path.owner, + input.path.repo ] ) 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.TeamsGetDiscussionCommentInOrg.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.TeamDiscussionComment.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a discussion comment - /// - /// Edits the body text of a discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-in-org)`. - public func teamsUpdateDiscussionCommentInOrg(_ input: Operations.TeamsUpdateDiscussionCommentInOrg.Input) async throws -> Operations.TeamsUpdateDiscussionCommentInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsUpdateDiscussionCommentInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateDiscussionCommentInOrg.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.TeamDiscussionComment.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) } } ) } - /// Delete a discussion comment + /// Remove a repository from a team /// - /// Deletes a comment on a team discussion. + /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)`. - public func teamsDeleteDiscussionCommentInOrg(_ input: Operations.TeamsDeleteDiscussionCommentInOrg.Input) async throws -> Operations.TeamsDeleteDiscussionCommentInOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)`. + public func teamsRemoveRepoInOrg(_ input: Operations.TeamsRemoveRepoInOrg.Input) async throws -> Operations.TeamsRemoveRepoInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsDeleteDiscussionCommentInOrg.id, + forOperation: Operations.TeamsRemoveRepoInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/discussions/{}/comments/{}", + template: "/orgs/{}/teams/{}/repos/{}/{}", parameters: [ input.path.org, input.path.teamSlug, - input.path.discussionNumber, - input.path.commentNumber + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1338,22 +1263,22 @@ public struct Client: APIProtocol { } ) } - /// List pending team invitations + /// List child teams /// - /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + /// Lists the child teams of the team specified by `{team_slug}`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)`. - public func teamsListPendingInvitationsInOrg(_ input: Operations.TeamsListPendingInvitationsInOrg.Input) async throws -> Operations.TeamsListPendingInvitationsInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)`. + public func teamsListChildInOrg(_ input: Operations.TeamsListChildInOrg.Input) async throws -> Operations.TeamsListChildInOrg.Output { try await client.send( input: input, - forOperation: Operations.TeamsListPendingInvitationsInOrg.id, + forOperation: Operations.TeamsListChildInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/invitations", + template: "/orgs/{}/teams/{}/teams", parameters: [ input.path.org, input.path.teamSlug @@ -1387,13 +1312,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.TeamsListChildInOrg.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.TeamsListPendingInvitationsInOrg.Output.Ok.Body + let body: Operations.TeamsListChildInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1403,7 +1328,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationInvitation].self, + [Components.Schemas.Team].self, from: responseBody, transforming: { value in .json(value) @@ -1428,24 +1353,23 @@ public struct Client: APIProtocol { } ) } - /// List team members - /// - /// Team members will include the members of child teams. + /// Get a team (Legacy) /// - /// To list members in a team, the team must be visible to the authenticated user. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)`. - public func teamsListMembersInOrg(_ input: Operations.TeamsListMembersInOrg.Input) async throws -> Operations.TeamsListMembersInOrg.Output { + /// - Remark: HTTP `GET /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. + @available(*, deprecated) + public func teamsGetLegacy(_ input: Operations.TeamsGetLegacy.Input) async throws -> Operations.TeamsGetLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsListMembersInOrg.id, + forOperation: Operations.TeamsGetLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/members", + template: "/teams/{}", parameters: [ - input.path.org, - input.path.teamSlug + input.path.teamId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1453,27 +1377,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "role", - value: input.query.role - ) - 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 @@ -1483,13 +1386,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListMembersInOrg.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.TeamsListMembersInOrg.Output.Ok.Body + let body: Operations.TeamsGetLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1499,7 +1397,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + Components.Schemas.TeamFull.self, from: responseBody, transforming: { value in .json(value) @@ -1508,10 +1406,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1524,51 +1441,55 @@ public struct Client: APIProtocol { } ) } - /// Get team membership for a user - /// - /// Team members will include the members of child teams. + /// Update a team (Legacy) /// - /// To get a user's membership with a team, the team must be visible to the authenticated user. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. + /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// /// > [!NOTE] - /// > The response contains the `state` of the membership and the member's `role`. - /// - /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). + /// > With nested teams, the `privacy` for parent teams cannot be `secret`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)`. - public func teamsGetMembershipForUserInOrg(_ input: Operations.TeamsGetMembershipForUserInOrg.Input) async throws -> Operations.TeamsGetMembershipForUserInOrg.Output { + /// - Remark: HTTP `PATCH /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)`. + @available(*, deprecated) + public func teamsUpdateLegacy(_ input: Operations.TeamsUpdateLegacy.Input) async throws -> Operations.TeamsUpdateLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsGetMembershipForUserInOrg.id, + forOperation: Operations.TeamsUpdateLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/memberships/{}", + template: "/teams/{}", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.username + input.path.teamId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body + let body: Operations.TeamsUpdateLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1578,7 +1499,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamMembership.self, + Components.Schemas.TeamFull.self, from: responseBody, transforming: { value in .json(value) @@ -1588,78 +1509,31 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add or update team membership for a user - /// - /// Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. - /// - /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)`. - public func teamsAddOrUpdateMembershipForUserInOrg(_ input: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input) async throws -> Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsAddOrUpdateMembershipForUserInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/memberships/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.TeamsUpdateLegacy.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.TeamFull.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1669,7 +1543,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamMembership.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1678,11 +1552,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 403: - return .forbidden(.init()) + return .notFound(.init(body: body)) case 422: - return .unprocessableContent(.init()) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1695,31 +1609,27 @@ public struct Client: APIProtocol { } ) } - /// Remove team membership for a user - /// - /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// Delete a team (Legacy) /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. + /// If you are an organization owner, deleting a parent team will delete all of its child teams as well. /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)`. - public func teamsRemoveMembershipForUserInOrg(_ input: Operations.TeamsRemoveMembershipForUserInOrg.Input) async throws -> Operations.TeamsRemoveMembershipForUserInOrg.Output { + /// - Remark: HTTP `DELETE /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)`. + @available(*, deprecated) + public func teamsDeleteLegacy(_ input: Operations.TeamsDeleteLegacy.Input) async throws -> Operations.TeamsDeleteLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsRemoveMembershipForUserInOrg.id, + forOperation: Operations.TeamsDeleteLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/memberships/{}", + template: "/teams/{}", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.username + input.path.teamId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1727,14 +1637,60 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 403: - return .forbidden(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1747,25 +1703,25 @@ public struct Client: APIProtocol { } ) } - /// List team projects + /// List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// + /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. + /// - Remark: HTTP `GET /teams/{team_id}/invitations`. + /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)`. @available(*, deprecated) - public func teamsListProjectsInOrg(_ input: Operations.TeamsListProjectsInOrg.Input) async throws -> Operations.TeamsListProjectsInOrg.Output { + public func teamsListPendingInvitationsLegacy(_ input: Operations.TeamsListPendingInvitationsLegacy.Input) async throws -> Operations.TeamsListPendingInvitationsLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsListProjectsInOrg.id, + forOperation: Operations.TeamsListPendingInvitationsLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/projects", + template: "/teams/{}/invitations", parameters: [ - input.path.org, - input.path.teamSlug + input.path.teamId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1796,13 +1752,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListProjectsInOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.TeamsListPendingInvitationsLegacy.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.TeamsListProjectsInOrg.Output.Ok.Body + let body: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1812,7 +1768,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamProject].self, + [Components.Schemas.OrganizationInvitation].self, from: responseBody, transforming: { value in .json(value) @@ -1837,26 +1793,25 @@ public struct Client: APIProtocol { } ) } - /// Check team permissions for a project + /// List team members (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. + /// Team members will include the members of child teams. + /// + /// - Remark: HTTP `GET /teams/{team_id}/members`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. @available(*, deprecated) - public func teamsCheckPermissionsForProjectInOrg(_ input: Operations.TeamsCheckPermissionsForProjectInOrg.Input) async throws -> Operations.TeamsCheckPermissionsForProjectInOrg.Output { + public func teamsListMembersLegacy(_ input: Operations.TeamsListMembersLegacy.Input) async throws -> Operations.TeamsListMembersLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsCheckPermissionsForProjectInOrg.id, + forOperation: Operations.TeamsListMembersLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/projects/{}", + template: "/teams/{}/members", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.projectId + input.path.teamId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1864,6 +1819,27 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "role", + value: input.query.role + ) + 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 @@ -1873,8 +1849,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsCheckPermissionsForProjectInOrg.Output.Ok.Body + let headers: Operations.TeamsListMembersLegacy.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.TeamsListMembersLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1884,7 +1865,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TeamProject.self, + [Components.Schemas.SimpleUser].self, from: responseBody, transforming: { value in .json(value) @@ -1893,72 +1874,13 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add or update team project permissions - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. - @available(*, deprecated) - public func teamsAddOrUpdateProjectPermissionsInOrg(_ input: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/projects/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.projectId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1968,7 +1890,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1977,7 +1899,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1990,70 +1912,27 @@ public struct Client: APIProtocol { } ) } - /// Remove a project from a team - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get team member (Legacy) /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. - @available(*, deprecated) - public func teamsRemoveProjectInOrg(_ input: Operations.TeamsRemoveProjectInOrg.Input) async throws -> Operations.TeamsRemoveProjectInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsRemoveProjectInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/projects/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.projectId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List team repositories + /// The "Get team member" endpoint (described below) is closing down. /// - /// Lists a team's repositories visible to the authenticated user. + /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. + /// To list members in a team, the team must be visible to the authenticated user. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. - public func teamsListReposInOrg(_ input: Operations.TeamsListReposInOrg.Input) async throws -> Operations.TeamsListReposInOrg.Output { + /// - Remark: HTTP `GET /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)`. + @available(*, deprecated) + public func teamsGetMemberLegacy(_ input: Operations.TeamsGetMemberLegacy.Input) async throws -> Operations.TeamsGetMemberLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsListReposInOrg.id, + forOperation: Operations.TeamsGetMemberLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/repos", + template: "/teams/{}/members/{}", parameters: [ - input.path.org, - input.path.teamSlug + input.path.teamId, + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2061,58 +1940,14 @@ 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 - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.TeamsListReposInOrg.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.TeamsListReposInOrg.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.MinimalRepository].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) + case 204: + return .noContent(.init()) + case 404: + return .notFound(.init()) default: return .undocumented( statusCode: response.status.code, @@ -2125,1969 +1960,58 @@ public struct Client: APIProtocol { } ) } - /// Check team permissions for a repository + /// Add team member (Legacy) /// - /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. + /// The "Add team member" endpoint (described below) is closing down. /// - /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. + /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// - /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// - /// If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status. + /// To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)`. - public func teamsCheckPermissionsForRepoInOrg(_ input: Operations.TeamsCheckPermissionsForRepoInOrg.Input) async throws -> Operations.TeamsCheckPermissionsForRepoInOrg.Output { + /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// + /// - Remark: HTTP `PUT /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)`. + @available(*, deprecated) + public func teamsAddMemberLegacy(_ input: Operations.TeamsAddMemberLegacy.Input) async throws -> Operations.TeamsAddMemberLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsCheckPermissionsForRepoInOrg.id, + forOperation: Operations.TeamsAddMemberLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/repos/{}/{}", + template: "/teams/{}/members/{}", parameters: [ - input.path.org, - input.path.teamSlug, - input.path.owner, - input.path.repo + input.path.teamId, + input.path.username ] ) 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.TeamsCheckPermissionsForRepoInOrg.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.TeamRepository.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()) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add or update team repository permissions - /// - /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. - /// - /// For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)`. - public func teamsAddOrUpdateRepoPermissionsInOrg(_ input: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input) async throws -> Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/repos/{}/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.owner, - input.path.repo - ] - ) - 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" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Remove a repository from a team - /// - /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)`. - public func teamsRemoveRepoInOrg(_ input: Operations.TeamsRemoveRepoInOrg.Input) async throws -> Operations.TeamsRemoveRepoInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsRemoveRepoInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/repos/{}/{}", - parameters: [ - input.path.org, - input.path.teamSlug, - input.path.owner, - input.path.repo - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List child teams - /// - /// Lists the child teams of the team specified by `{team_slug}`. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)`. - public func teamsListChildInOrg(_ input: Operations.TeamsListChildInOrg.Input) async throws -> Operations.TeamsListChildInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsListChildInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/teams/{}/teams", - parameters: [ - input.path.org, - input.path.teamSlug - ] - ) - 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.TeamsListChildInOrg.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.TeamsListChildInOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Team].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. - @available(*, deprecated) - public func teamsGetLegacy(_ input: Operations.TeamsGetLegacy.Input) async throws -> Operations.TeamsGetLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsGetLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetLegacy.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.TeamFull.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. - /// - /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. - /// - /// > [!NOTE] - /// > With nested teams, the `privacy` for parent teams cannot be `secret`. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)`. - @available(*, deprecated) - public func teamsUpdateLegacy(_ input: Operations.TeamsUpdateLegacy.Input) async throws -> Operations.TeamsUpdateLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsUpdateLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateLegacy.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.TeamFull.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateLegacy.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.TeamFull.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. - /// - /// To delete a team, the authenticated user must be an organization owner or team maintainer. - /// - /// If you are an organization owner, deleting a parent team will delete all of its child teams as well. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)`. - @available(*, deprecated) - public func teamsDeleteLegacy(_ input: Operations.TeamsDeleteLegacy.Input) async throws -> Operations.TeamsDeleteLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsDeleteLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.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 - ) - ) - } - } - ) - } - /// List discussions (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. - /// - /// List all discussions on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/get(teams/list-discussions-legacy)`. - @available(*, deprecated) - public func teamsListDiscussionsLegacy(_ input: Operations.TeamsListDiscussionsLegacy.Input) async throws -> Operations.TeamsListDiscussionsLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsListDiscussionsLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "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.TeamsListDiscussionsLegacy.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.TeamsListDiscussionsLegacy.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.TeamDiscussion].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/post(teams/create-discussion-legacy)`. - @available(*, deprecated) - public func teamsCreateDiscussionLegacy(_ input: Operations.TeamsCreateDiscussionLegacy.Input) async throws -> Operations.TeamsCreateDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsCreateDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsCreateDiscussionLegacy.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.TeamDiscussion.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. - /// - /// Get a specific discussion on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/get(teams/get-discussion-legacy)`. - @available(*, deprecated) - public func teamsGetDiscussionLegacy(_ input: Operations.TeamsGetDiscussionLegacy.Input) async throws -> Operations.TeamsGetDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsGetDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetDiscussionLegacy.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.TeamDiscussion.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/patch(teams/update-discussion-legacy)`. - @available(*, deprecated) - public func teamsUpdateDiscussionLegacy(_ input: Operations.TeamsUpdateDiscussionLegacy.Input) async throws -> Operations.TeamsUpdateDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsUpdateDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateDiscussionLegacy.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.TeamDiscussion.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. - /// - /// Delete a discussion from a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)`. - @available(*, deprecated) - public func teamsDeleteDiscussionLegacy(_ input: Operations.TeamsDeleteDiscussionLegacy.Input) async throws -> Operations.TeamsDeleteDiscussionLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsDeleteDiscussionLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List discussion comments (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. - /// - /// List all comments on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-legacy)`. - @available(*, deprecated) - public func teamsListDiscussionCommentsLegacy(_ input: Operations.TeamsListDiscussionCommentsLegacy.Input) async throws -> Operations.TeamsListDiscussionCommentsLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsListDiscussionCommentsLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "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.TeamsListDiscussionCommentsLegacy.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.TeamsListDiscussionCommentsLegacy.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.TeamDiscussionComment].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsCreateDiscussionCommentLegacy(_ input: Operations.TeamsCreateDiscussionCommentLegacy.Input) async throws -> Operations.TeamsCreateDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsCreateDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments", - parameters: [ - input.path.teamId, - input.path.discussionNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsCreateDiscussionCommentLegacy.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.TeamDiscussionComment.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. - /// - /// Get a specific comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsGetDiscussionCommentLegacy(_ input: Operations.TeamsGetDiscussionCommentLegacy.Input) async throws -> Operations.TeamsGetDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsGetDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetDiscussionCommentLegacy.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.TeamDiscussionComment.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. - /// - /// Edits the body text of a discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsUpdateDiscussionCommentLegacy(_ input: Operations.TeamsUpdateDiscussionCommentLegacy.Input) async throws -> Operations.TeamsUpdateDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsUpdateDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsUpdateDiscussionCommentLegacy.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.TeamDiscussionComment.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. - /// - /// Deletes a comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsDeleteDiscussionCommentLegacy(_ input: Operations.TeamsDeleteDiscussionCommentLegacy.Input) async throws -> Operations.TeamsDeleteDiscussionCommentLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsDeleteDiscussionCommentLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/discussions/{}/comments/{}", - parameters: [ - input.path.teamId, - input.path.discussionNumber, - input.path.commentNumber - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List pending team invitations (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. - /// - /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. - /// - /// - Remark: HTTP `GET /teams/{team_id}/invitations`. - /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)`. - @available(*, deprecated) - public func teamsListPendingInvitationsLegacy(_ input: Operations.TeamsListPendingInvitationsLegacy.Input) async throws -> Operations.TeamsListPendingInvitationsLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsListPendingInvitationsLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/invitations", - parameters: [ - input.path.teamId - ] - ) - 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.TeamsListPendingInvitationsLegacy.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.TeamsListPendingInvitationsLegacy.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.OrganizationInvitation].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List team members (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. - /// - /// Team members will include the members of child teams. - /// - /// - Remark: HTTP `GET /teams/{team_id}/members`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. - @available(*, deprecated) - public func teamsListMembersLegacy(_ input: Operations.TeamsListMembersLegacy.Input) async throws -> Operations.TeamsListMembersLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsListMembersLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/members", - parameters: [ - input.path.teamId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "role", - value: input.query.role - ) - 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.TeamsListMembersLegacy.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.TeamsListMembersLegacy.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get team member (Legacy) - /// - /// The "Get team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. - /// - /// To list members in a team, the team must be visible to the authenticated user. - /// - /// - Remark: HTTP `GET /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)`. - @available(*, deprecated) - public func teamsGetMemberLegacy(_ input: Operations.TeamsGetMemberLegacy.Input) async throws -> Operations.TeamsGetMemberLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsGetMemberLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/members/{}", - parameters: [ - input.path.teamId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add team member (Legacy) - /// - /// The "Add team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// - Remark: HTTP `PUT /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)`. - @available(*, deprecated) - public func teamsAddMemberLegacy(_ input: Operations.TeamsAddMemberLegacy.Input) async throws -> Operations.TeamsAddMemberLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsAddMemberLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/members/{}", - parameters: [ - input.path.teamId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - 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 404: - return .notFound(.init()) - case 422: - return .unprocessableContent(.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)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Remove team member (Legacy) - /// - /// The "Remove team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)`. - @available(*, deprecated) - public func teamsRemoveMemberLegacy(_ input: Operations.TeamsRemoveMemberLegacy.Input) async throws -> Operations.TeamsRemoveMemberLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsRemoveMemberLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/members/{}", - parameters: [ - input.path.teamId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get team membership for a user (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. - /// - /// Team members will include the members of child teams. - /// - /// To get a user's membership with a team, the team must be visible to the authenticated user. - /// - /// **Note:** - /// The response contains the `state` of the membership and the member's `role`. - /// - /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). - /// - /// - Remark: HTTP `GET /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)`. - @available(*, deprecated) - public func teamsGetMembershipForUserLegacy(_ input: Operations.TeamsGetMembershipForUserLegacy.Input) async throws -> Operations.TeamsGetMembershipForUserLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsGetMembershipForUserLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/memberships/{}", - parameters: [ - input.path.teamId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsGetMembershipForUserLegacy.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.TeamMembership.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add or update team membership for a user (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. - /// - /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. - /// - /// - Remark: HTTP `PUT /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)`. - @available(*, deprecated) - public func teamsAddOrUpdateMembershipForUserLegacy(_ input: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input) async throws -> Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsAddOrUpdateMembershipForUserLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/memberships/{}", - parameters: [ - input.path.teamId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.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.TeamMembership.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 403: - return .forbidden(.init()) + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + return .notFound(.init()) case 422: return .unprocessableContent(.init()) - case 404: + 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: [ @@ -4106,7 +2030,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4119,28 +2043,29 @@ public struct Client: APIProtocol { } ) } - /// Remove team membership for a user (Legacy) + /// Remove team member (Legacy) /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// The "Remove team member" endpoint (described below) is closing down. + /// + /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// - /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. /// /// > [!NOTE] /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `DELETE /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)`. + /// - Remark: HTTP `DELETE /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)`. @available(*, deprecated) - public func teamsRemoveMembershipForUserLegacy(_ input: Operations.TeamsRemoveMembershipForUserLegacy.Input) async throws -> Operations.TeamsRemoveMembershipForUserLegacy.Output { + public func teamsRemoveMemberLegacy(_ input: Operations.TeamsRemoveMemberLegacy.Input) async throws -> Operations.TeamsRemoveMemberLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsRemoveMembershipForUserLegacy.id, + forOperation: Operations.TeamsRemoveMemberLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/teams/{}/memberships/{}", + template: "/teams/{}/members/{}", parameters: [ input.path.teamId, input.path.username @@ -4157,8 +2082,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 403: - return .forbidden(.init()) + case 404: + return .notFound(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4171,24 +2096,33 @@ public struct Client: APIProtocol { } ) } - /// List team projects (Legacy) + /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// + /// Team members will include the members of child teams. + /// + /// To get a user's membership with a team, the team must be visible to the authenticated user. + /// + /// **Note:** + /// The response contains the `state` of the membership and the member's `role`. /// - /// - Remark: HTTP `GET /teams/{team_id}/projects`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. + /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). + /// + /// - Remark: HTTP `GET /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)`. @available(*, deprecated) - public func teamsListProjectsLegacy(_ input: Operations.TeamsListProjectsLegacy.Input) async throws -> Operations.TeamsListProjectsLegacy.Output { + public func teamsGetMembershipForUserLegacy(_ input: Operations.TeamsGetMembershipForUserLegacy.Input) async throws -> Operations.TeamsGetMembershipForUserLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsListProjectsLegacy.id, + forOperation: Operations.TeamsGetMembershipForUserLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/teams/{}/projects", + template: "/teams/{}/memberships/{}", parameters: [ - input.path.teamId + input.path.teamId, + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4196,20 +2130,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 @@ -4219,13 +2139,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.TeamsListProjectsLegacy.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.TeamsListProjectsLegacy.Output.Ok.Body + let body: Operations.TeamsGetMembershipForUserLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4235,7 +2150,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamProject].self, + Components.Schemas.TeamMembership.self, from: responseBody, transforming: { value in .json(value) @@ -4244,10 +2159,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4282,95 +2194,35 @@ public struct Client: APIProtocol { } ) } - /// Check team permissions for a project (Legacy) + /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// - /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. - @available(*, deprecated) - public func teamsCheckPermissionsForProjectLegacy(_ input: Operations.TeamsCheckPermissionsForProjectLegacy.Input) async throws -> Operations.TeamsCheckPermissionsForProjectLegacy.Output { - try await client.send( - input: input, - forOperation: Operations.TeamsCheckPermissionsForProjectLegacy.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/teams/{}/projects/{}", - parameters: [ - input.path.teamId, - input.path.projectId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.TeamsCheckPermissionsForProjectLegacy.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.TeamProject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add or update team project permissions (Legacy) + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. /// - /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. + /// > [!NOTE] + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// + /// If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. + /// + /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + /// + /// - Remark: HTTP `PUT /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)`. @available(*, deprecated) - public func teamsAddOrUpdateProjectPermissionsLegacy(_ input: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output { + public func teamsAddOrUpdateMembershipForUserLegacy(_ input: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input) async throws -> Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.id, + forOperation: Operations.TeamsAddOrUpdateMembershipForUserLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/teams/{}/projects/{}", + template: "/teams/{}/memberships/{}", parameters: [ input.path.teamId, - input.path.projectId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4397,11 +2249,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: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body + let body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4411,7 +2261,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body.JsonPayload.self, + Components.Schemas.TeamMembership.self, from: responseBody, transforming: { value in .json(value) @@ -4420,7 +2270,11 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .ok(.init(body: body)) + case 403: + return .forbidden(.init()) + case 422: + return .unprocessableContent(.init()) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4443,28 +2297,6 @@ public struct Client: APIProtocol { 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, @@ -4477,25 +2309,31 @@ public struct Client: APIProtocol { } ) } - /// Remove a project from a team (Legacy) + /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// + /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// + /// > [!NOTE] + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. + /// - Remark: HTTP `DELETE /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)`. @available(*, deprecated) - public func teamsRemoveProjectLegacy(_ input: Operations.TeamsRemoveProjectLegacy.Input) async throws -> Operations.TeamsRemoveProjectLegacy.Output { + public func teamsRemoveMembershipForUserLegacy(_ input: Operations.TeamsRemoveMembershipForUserLegacy.Input) async throws -> Operations.TeamsRemoveMembershipForUserLegacy.Output { try await client.send( input: input, - forOperation: Operations.TeamsRemoveProjectLegacy.id, + forOperation: Operations.TeamsRemoveMembershipForUserLegacy.id, serializer: { input in let path = try converter.renderedPath( - template: "/teams/{}/projects/{}", + template: "/teams/{}/memberships/{}", parameters: [ input.path.teamId, - input.path.projectId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4503,60 +2341,14 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + case 403: + return .forbidden(.init()) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 6ecd3e5bcc..2113a42d7e 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -59,130 +59,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/delete(teams/delete-in-org)`. func teamsDeleteInOrg(_ input: Operations.TeamsDeleteInOrg.Input) async throws -> Operations.TeamsDeleteInOrg.Output - /// List discussions - /// - /// List all discussions on a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/get(teams/list-discussions-in-org)`. - func teamsListDiscussionsInOrg(_ input: Operations.TeamsListDiscussionsInOrg.Input) async throws -> Operations.TeamsListDiscussionsInOrg.Output - /// Create a discussion - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/post(teams/create-discussion-in-org)`. - func teamsCreateDiscussionInOrg(_ input: Operations.TeamsCreateDiscussionInOrg.Input) async throws -> Operations.TeamsCreateDiscussionInOrg.Output - /// Get a discussion - /// - /// Get a specific discussion on a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/get(teams/get-discussion-in-org)`. - func teamsGetDiscussionInOrg(_ input: Operations.TeamsGetDiscussionInOrg.Input) async throws -> Operations.TeamsGetDiscussionInOrg.Output - /// Update a discussion - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/patch(teams/update-discussion-in-org)`. - func teamsUpdateDiscussionInOrg(_ input: Operations.TeamsUpdateDiscussionInOrg.Input) async throws -> Operations.TeamsUpdateDiscussionInOrg.Output - /// Delete a discussion - /// - /// Delete a discussion from a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)`. - func teamsDeleteDiscussionInOrg(_ input: Operations.TeamsDeleteDiscussionInOrg.Input) async throws -> Operations.TeamsDeleteDiscussionInOrg.Output - /// List discussion comments - /// - /// List all comments on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-in-org)`. - func teamsListDiscussionCommentsInOrg(_ input: Operations.TeamsListDiscussionCommentsInOrg.Input) async throws -> Operations.TeamsListDiscussionCommentsInOrg.Output - /// Create a discussion comment - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-in-org)`. - func teamsCreateDiscussionCommentInOrg(_ input: Operations.TeamsCreateDiscussionCommentInOrg.Input) async throws -> Operations.TeamsCreateDiscussionCommentInOrg.Output - /// Get a discussion comment - /// - /// Get a specific comment on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-in-org)`. - func teamsGetDiscussionCommentInOrg(_ input: Operations.TeamsGetDiscussionCommentInOrg.Input) async throws -> Operations.TeamsGetDiscussionCommentInOrg.Output - /// Update a discussion comment - /// - /// Edits the body text of a discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-in-org)`. - func teamsUpdateDiscussionCommentInOrg(_ input: Operations.TeamsUpdateDiscussionCommentInOrg.Input) async throws -> Operations.TeamsUpdateDiscussionCommentInOrg.Output - /// Delete a discussion comment - /// - /// Deletes a comment on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)`. - func teamsDeleteDiscussionCommentInOrg(_ input: Operations.TeamsDeleteDiscussionCommentInOrg.Input) async throws -> Operations.TeamsDeleteDiscussionCommentInOrg.Output /// List pending team invitations /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. @@ -253,46 +129,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)`. func teamsRemoveMembershipForUserInOrg(_ input: Operations.TeamsRemoveMembershipForUserInOrg.Input) async throws -> Operations.TeamsRemoveMembershipForUserInOrg.Output - /// List team projects - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. - @available(*, deprecated) - func teamsListProjectsInOrg(_ input: Operations.TeamsListProjectsInOrg.Input) async throws -> Operations.TeamsListProjectsInOrg.Output - /// Check team permissions for a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. - @available(*, deprecated) - func teamsCheckPermissionsForProjectInOrg(_ input: Operations.TeamsCheckPermissionsForProjectInOrg.Input) async throws -> Operations.TeamsCheckPermissionsForProjectInOrg.Output - /// Add or update team project permissions - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. - @available(*, deprecated) - func teamsAddOrUpdateProjectPermissionsInOrg(_ input: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output - /// Remove a project from a team - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. - @available(*, deprecated) - func teamsRemoveProjectInOrg(_ input: Operations.TeamsRemoveProjectInOrg.Input) async throws -> Operations.TeamsRemoveProjectInOrg.Output /// List team repositories /// /// Lists a team's repositories visible to the authenticated user. @@ -387,140 +223,6 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)`. @available(*, deprecated) func teamsDeleteLegacy(_ input: Operations.TeamsDeleteLegacy.Input) async throws -> Operations.TeamsDeleteLegacy.Output - /// List discussions (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. - /// - /// List all discussions on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/get(teams/list-discussions-legacy)`. - @available(*, deprecated) - func teamsListDiscussionsLegacy(_ input: Operations.TeamsListDiscussionsLegacy.Input) async throws -> Operations.TeamsListDiscussionsLegacy.Output - /// Create a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/post(teams/create-discussion-legacy)`. - @available(*, deprecated) - func teamsCreateDiscussionLegacy(_ input: Operations.TeamsCreateDiscussionLegacy.Input) async throws -> Operations.TeamsCreateDiscussionLegacy.Output - /// Get a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. - /// - /// Get a specific discussion on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/get(teams/get-discussion-legacy)`. - @available(*, deprecated) - func teamsGetDiscussionLegacy(_ input: Operations.TeamsGetDiscussionLegacy.Input) async throws -> Operations.TeamsGetDiscussionLegacy.Output - /// Update a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/patch(teams/update-discussion-legacy)`. - @available(*, deprecated) - func teamsUpdateDiscussionLegacy(_ input: Operations.TeamsUpdateDiscussionLegacy.Input) async throws -> Operations.TeamsUpdateDiscussionLegacy.Output - /// Delete a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. - /// - /// Delete a discussion from a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)`. - @available(*, deprecated) - func teamsDeleteDiscussionLegacy(_ input: Operations.TeamsDeleteDiscussionLegacy.Input) async throws -> Operations.TeamsDeleteDiscussionLegacy.Output - /// List discussion comments (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. - /// - /// List all comments on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-legacy)`. - @available(*, deprecated) - func teamsListDiscussionCommentsLegacy(_ input: Operations.TeamsListDiscussionCommentsLegacy.Input) async throws -> Operations.TeamsListDiscussionCommentsLegacy.Output - /// Create a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-legacy)`. - @available(*, deprecated) - func teamsCreateDiscussionCommentLegacy(_ input: Operations.TeamsCreateDiscussionCommentLegacy.Input) async throws -> Operations.TeamsCreateDiscussionCommentLegacy.Output - /// Get a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. - /// - /// Get a specific comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-legacy)`. - @available(*, deprecated) - func teamsGetDiscussionCommentLegacy(_ input: Operations.TeamsGetDiscussionCommentLegacy.Input) async throws -> Operations.TeamsGetDiscussionCommentLegacy.Output - /// Update a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. - /// - /// Edits the body text of a discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-legacy)`. - @available(*, deprecated) - func teamsUpdateDiscussionCommentLegacy(_ input: Operations.TeamsUpdateDiscussionCommentLegacy.Input) async throws -> Operations.TeamsUpdateDiscussionCommentLegacy.Output - /// Delete a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. - /// - /// Deletes a comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)`. - @available(*, deprecated) - func teamsDeleteDiscussionCommentLegacy(_ input: Operations.TeamsDeleteDiscussionCommentLegacy.Input) async throws -> Operations.TeamsDeleteDiscussionCommentLegacy.Output /// List pending team invitations (Legacy) /// /// > [!WARNING] @@ -645,46 +347,6 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)`. @available(*, deprecated) func teamsRemoveMembershipForUserLegacy(_ input: Operations.TeamsRemoveMembershipForUserLegacy.Input) async throws -> Operations.TeamsRemoveMembershipForUserLegacy.Output - /// List team projects (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /teams/{team_id}/projects`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. - @available(*, deprecated) - func teamsListProjectsLegacy(_ input: Operations.TeamsListProjectsLegacy.Input) async throws -> Operations.TeamsListProjectsLegacy.Output - /// Check team permissions for a project (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. - @available(*, deprecated) - func teamsCheckPermissionsForProjectLegacy(_ input: Operations.TeamsCheckPermissionsForProjectLegacy.Input) async throws -> Operations.TeamsCheckPermissionsForProjectLegacy.Output - /// Add or update team project permissions (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. - @available(*, deprecated) - func teamsAddOrUpdateProjectPermissionsLegacy(_ input: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output - /// Remove a project from a team (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. - @available(*, deprecated) - func teamsRemoveProjectLegacy(_ input: Operations.TeamsRemoveProjectLegacy.Input) async throws -> Operations.TeamsRemoveProjectLegacy.Output /// List team repositories (Legacy) /// /// > [!WARNING] @@ -845,210 +507,6 @@ extension APIProtocol { public func teamsDeleteInOrg(path: Operations.TeamsDeleteInOrg.Input.Path) async throws -> Operations.TeamsDeleteInOrg.Output { try await teamsDeleteInOrg(Operations.TeamsDeleteInOrg.Input(path: path)) } - /// List discussions - /// - /// List all discussions on a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/get(teams/list-discussions-in-org)`. - public func teamsListDiscussionsInOrg( - path: Operations.TeamsListDiscussionsInOrg.Input.Path, - query: Operations.TeamsListDiscussionsInOrg.Input.Query = .init(), - headers: Operations.TeamsListDiscussionsInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsListDiscussionsInOrg.Output { - try await teamsListDiscussionsInOrg(Operations.TeamsListDiscussionsInOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a discussion - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/post(teams/create-discussion-in-org)`. - public func teamsCreateDiscussionInOrg( - path: Operations.TeamsCreateDiscussionInOrg.Input.Path, - headers: Operations.TeamsCreateDiscussionInOrg.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionInOrg.Input.Body - ) async throws -> Operations.TeamsCreateDiscussionInOrg.Output { - try await teamsCreateDiscussionInOrg(Operations.TeamsCreateDiscussionInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a discussion - /// - /// Get a specific discussion on a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/get(teams/get-discussion-in-org)`. - public func teamsGetDiscussionInOrg( - path: Operations.TeamsGetDiscussionInOrg.Input.Path, - headers: Operations.TeamsGetDiscussionInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsGetDiscussionInOrg.Output { - try await teamsGetDiscussionInOrg(Operations.TeamsGetDiscussionInOrg.Input( - path: path, - headers: headers - )) - } - /// Update a discussion - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/patch(teams/update-discussion-in-org)`. - public func teamsUpdateDiscussionInOrg( - path: Operations.TeamsUpdateDiscussionInOrg.Input.Path, - headers: Operations.TeamsUpdateDiscussionInOrg.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionInOrg.Input.Body? = nil - ) async throws -> Operations.TeamsUpdateDiscussionInOrg.Output { - try await teamsUpdateDiscussionInOrg(Operations.TeamsUpdateDiscussionInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a discussion - /// - /// Delete a discussion from a team's page. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)`. - public func teamsDeleteDiscussionInOrg(path: Operations.TeamsDeleteDiscussionInOrg.Input.Path) async throws -> Operations.TeamsDeleteDiscussionInOrg.Output { - try await teamsDeleteDiscussionInOrg(Operations.TeamsDeleteDiscussionInOrg.Input(path: path)) - } - /// List discussion comments - /// - /// List all comments on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-in-org)`. - public func teamsListDiscussionCommentsInOrg( - path: Operations.TeamsListDiscussionCommentsInOrg.Input.Path, - query: Operations.TeamsListDiscussionCommentsInOrg.Input.Query = .init(), - headers: Operations.TeamsListDiscussionCommentsInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsListDiscussionCommentsInOrg.Output { - try await teamsListDiscussionCommentsInOrg(Operations.TeamsListDiscussionCommentsInOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a discussion comment - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-in-org)`. - public func teamsCreateDiscussionCommentInOrg( - path: Operations.TeamsCreateDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsCreateDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionCommentInOrg.Input.Body - ) async throws -> Operations.TeamsCreateDiscussionCommentInOrg.Output { - try await teamsCreateDiscussionCommentInOrg(Operations.TeamsCreateDiscussionCommentInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a discussion comment - /// - /// Get a specific comment on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-in-org)`. - public func teamsGetDiscussionCommentInOrg( - path: Operations.TeamsGetDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsGetDiscussionCommentInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsGetDiscussionCommentInOrg.Output { - try await teamsGetDiscussionCommentInOrg(Operations.TeamsGetDiscussionCommentInOrg.Input( - path: path, - headers: headers - )) - } - /// Update a discussion comment - /// - /// Edits the body text of a discussion comment. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-in-org)`. - public func teamsUpdateDiscussionCommentInOrg( - path: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Body - ) async throws -> Operations.TeamsUpdateDiscussionCommentInOrg.Output { - try await teamsUpdateDiscussionCommentInOrg(Operations.TeamsUpdateDiscussionCommentInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a discussion comment - /// - /// Deletes a comment on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)`. - public func teamsDeleteDiscussionCommentInOrg(path: Operations.TeamsDeleteDiscussionCommentInOrg.Input.Path) async throws -> Operations.TeamsDeleteDiscussionCommentInOrg.Output { - try await teamsDeleteDiscussionCommentInOrg(Operations.TeamsDeleteDiscussionCommentInOrg.Input(path: path)) - } /// List pending team invitations /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. @@ -1159,103 +617,33 @@ extension APIProtocol { public func teamsRemoveMembershipForUserInOrg(path: Operations.TeamsRemoveMembershipForUserInOrg.Input.Path) async throws -> Operations.TeamsRemoveMembershipForUserInOrg.Output { try await teamsRemoveMembershipForUserInOrg(Operations.TeamsRemoveMembershipForUserInOrg.Input(path: path)) } - /// List team projects + /// List team repositories /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Lists a team's repositories visible to the authenticated user. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. - @available(*, deprecated) - public func teamsListProjectsInOrg( - path: Operations.TeamsListProjectsInOrg.Input.Path, - query: Operations.TeamsListProjectsInOrg.Input.Query = .init(), - headers: Operations.TeamsListProjectsInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsListProjectsInOrg.Output { - try await teamsListProjectsInOrg(Operations.TeamsListProjectsInOrg.Input( + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. + /// + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. + public func teamsListReposInOrg( + path: Operations.TeamsListReposInOrg.Input.Path, + query: Operations.TeamsListReposInOrg.Input.Query = .init(), + headers: Operations.TeamsListReposInOrg.Input.Headers = .init() + ) async throws -> Operations.TeamsListReposInOrg.Output { + try await teamsListReposInOrg(Operations.TeamsListReposInOrg.Input( path: path, query: query, headers: headers )) } - /// Check team permissions for a project + /// Check team permissions for a repository /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. - @available(*, deprecated) - public func teamsCheckPermissionsForProjectInOrg( - path: Operations.TeamsCheckPermissionsForProjectInOrg.Input.Path, - headers: Operations.TeamsCheckPermissionsForProjectInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsCheckPermissionsForProjectInOrg.Output { - try await teamsCheckPermissionsForProjectInOrg(Operations.TeamsCheckPermissionsForProjectInOrg.Input( - path: path, - headers: headers - )) - } - /// Add or update team project permissions + /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. - @available(*, deprecated) - public func teamsAddOrUpdateProjectPermissionsInOrg( - path: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Path, - headers: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body? = nil - ) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output { - try await teamsAddOrUpdateProjectPermissionsInOrg(Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Remove a project from a team - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. - @available(*, deprecated) - public func teamsRemoveProjectInOrg(path: Operations.TeamsRemoveProjectInOrg.Input.Path) async throws -> Operations.TeamsRemoveProjectInOrg.Output { - try await teamsRemoveProjectInOrg(Operations.TeamsRemoveProjectInOrg.Input(path: path)) - } - /// List team repositories - /// - /// Lists a team's repositories visible to the authenticated user. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. - public func teamsListReposInOrg( - path: Operations.TeamsListReposInOrg.Input.Path, - query: Operations.TeamsListReposInOrg.Input.Query = .init(), - headers: Operations.TeamsListReposInOrg.Input.Headers = .init() - ) async throws -> Operations.TeamsListReposInOrg.Output { - try await teamsListReposInOrg(Operations.TeamsListReposInOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Check team permissions for a repository - /// - /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. - /// - /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. - /// - /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. + /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. /// /// If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status. /// @@ -1387,220 +775,6 @@ extension APIProtocol { headers: headers )) } - /// List discussions (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. - /// - /// List all discussions on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/get(teams/list-discussions-legacy)`. - @available(*, deprecated) - public func teamsListDiscussionsLegacy( - path: Operations.TeamsListDiscussionsLegacy.Input.Path, - query: Operations.TeamsListDiscussionsLegacy.Input.Query = .init(), - headers: Operations.TeamsListDiscussionsLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsListDiscussionsLegacy.Output { - try await teamsListDiscussionsLegacy(Operations.TeamsListDiscussionsLegacy.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/post(teams/create-discussion-legacy)`. - @available(*, deprecated) - public func teamsCreateDiscussionLegacy( - path: Operations.TeamsCreateDiscussionLegacy.Input.Path, - headers: Operations.TeamsCreateDiscussionLegacy.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionLegacy.Input.Body - ) async throws -> Operations.TeamsCreateDiscussionLegacy.Output { - try await teamsCreateDiscussionLegacy(Operations.TeamsCreateDiscussionLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. - /// - /// Get a specific discussion on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/get(teams/get-discussion-legacy)`. - @available(*, deprecated) - public func teamsGetDiscussionLegacy( - path: Operations.TeamsGetDiscussionLegacy.Input.Path, - headers: Operations.TeamsGetDiscussionLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsGetDiscussionLegacy.Output { - try await teamsGetDiscussionLegacy(Operations.TeamsGetDiscussionLegacy.Input( - path: path, - headers: headers - )) - } - /// Update a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/patch(teams/update-discussion-legacy)`. - @available(*, deprecated) - public func teamsUpdateDiscussionLegacy( - path: Operations.TeamsUpdateDiscussionLegacy.Input.Path, - headers: Operations.TeamsUpdateDiscussionLegacy.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionLegacy.Input.Body? = nil - ) async throws -> Operations.TeamsUpdateDiscussionLegacy.Output { - try await teamsUpdateDiscussionLegacy(Operations.TeamsUpdateDiscussionLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. - /// - /// Delete a discussion from a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)`. - @available(*, deprecated) - public func teamsDeleteDiscussionLegacy(path: Operations.TeamsDeleteDiscussionLegacy.Input.Path) async throws -> Operations.TeamsDeleteDiscussionLegacy.Output { - try await teamsDeleteDiscussionLegacy(Operations.TeamsDeleteDiscussionLegacy.Input(path: path)) - } - /// List discussion comments (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. - /// - /// List all comments on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-legacy)`. - @available(*, deprecated) - public func teamsListDiscussionCommentsLegacy( - path: Operations.TeamsListDiscussionCommentsLegacy.Input.Path, - query: Operations.TeamsListDiscussionCommentsLegacy.Input.Query = .init(), - headers: Operations.TeamsListDiscussionCommentsLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsListDiscussionCommentsLegacy.Output { - try await teamsListDiscussionCommentsLegacy(Operations.TeamsListDiscussionCommentsLegacy.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsCreateDiscussionCommentLegacy( - path: Operations.TeamsCreateDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsCreateDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionCommentLegacy.Input.Body - ) async throws -> Operations.TeamsCreateDiscussionCommentLegacy.Output { - try await teamsCreateDiscussionCommentLegacy(Operations.TeamsCreateDiscussionCommentLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. - /// - /// Get a specific comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsGetDiscussionCommentLegacy( - path: Operations.TeamsGetDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsGetDiscussionCommentLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsGetDiscussionCommentLegacy.Output { - try await teamsGetDiscussionCommentLegacy(Operations.TeamsGetDiscussionCommentLegacy.Input( - path: path, - headers: headers - )) - } - /// Update a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. - /// - /// Edits the body text of a discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsUpdateDiscussionCommentLegacy( - path: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Body - ) async throws -> Operations.TeamsUpdateDiscussionCommentLegacy.Output { - try await teamsUpdateDiscussionCommentLegacy(Operations.TeamsUpdateDiscussionCommentLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. - /// - /// Deletes a comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)`. - @available(*, deprecated) - public func teamsDeleteDiscussionCommentLegacy(path: Operations.TeamsDeleteDiscussionCommentLegacy.Input.Path) async throws -> Operations.TeamsDeleteDiscussionCommentLegacy.Output { - try await teamsDeleteDiscussionCommentLegacy(Operations.TeamsDeleteDiscussionCommentLegacy.Input(path: path)) - } /// List pending team invitations (Legacy) /// /// > [!WARNING] @@ -1777,82 +951,6 @@ extension APIProtocol { public func teamsRemoveMembershipForUserLegacy(path: Operations.TeamsRemoveMembershipForUserLegacy.Input.Path) async throws -> Operations.TeamsRemoveMembershipForUserLegacy.Output { try await teamsRemoveMembershipForUserLegacy(Operations.TeamsRemoveMembershipForUserLegacy.Input(path: path)) } - /// List team projects (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /teams/{team_id}/projects`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. - @available(*, deprecated) - public func teamsListProjectsLegacy( - path: Operations.TeamsListProjectsLegacy.Input.Path, - query: Operations.TeamsListProjectsLegacy.Input.Query = .init(), - headers: Operations.TeamsListProjectsLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsListProjectsLegacy.Output { - try await teamsListProjectsLegacy(Operations.TeamsListProjectsLegacy.Input( - path: path, - query: query, - headers: headers - )) - } - /// Check team permissions for a project (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. - @available(*, deprecated) - public func teamsCheckPermissionsForProjectLegacy( - path: Operations.TeamsCheckPermissionsForProjectLegacy.Input.Path, - headers: Operations.TeamsCheckPermissionsForProjectLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsCheckPermissionsForProjectLegacy.Output { - try await teamsCheckPermissionsForProjectLegacy(Operations.TeamsCheckPermissionsForProjectLegacy.Input( - path: path, - headers: headers - )) - } - /// Add or update team project permissions (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. - @available(*, deprecated) - public func teamsAddOrUpdateProjectPermissionsLegacy( - path: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Path, - headers: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body? = nil - ) async throws -> Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output { - try await teamsAddOrUpdateProjectPermissionsLegacy(Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input( - path: path, - headers: headers, - body: body - )) - } - /// Remove a project from a team (Legacy) - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. - @available(*, deprecated) - public func teamsRemoveProjectLegacy( - path: Operations.TeamsRemoveProjectLegacy.Input.Path, - headers: Operations.TeamsRemoveProjectLegacy.Input.Headers = .init() - ) async throws -> Operations.TeamsRemoveProjectLegacy.Output { - try await teamsRemoveProjectLegacy(Operations.TeamsRemoveProjectLegacy.Input( - path: path, - headers: headers - )) - } /// List team repositories (Legacy) /// /// > [!WARNING] @@ -2204,8 +1302,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -2230,7 +1328,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -2538,77 +1636,6 @@ public enum Components { case htmlUrl = "html_url" } } - /// - Remark: Generated from `#/components/schemas/reaction-rollup`. - public struct ReactionRollup: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. - public var _plus_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. - public var _hyphen_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. - public var laugh: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. - public var confused: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. - public var heart: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. - public var hooray: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. - public var eyes: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. - public var rocket: Swift.Int - /// Creates a new `ReactionRollup`. - /// - /// - Parameters: - /// - url: - /// - totalCount: - /// - _plus_1: - /// - _hyphen_1: - /// - laugh: - /// - confused: - /// - heart: - /// - hooray: - /// - eyes: - /// - rocket: - public init( - url: Swift.String, - totalCount: Swift.Int, - _plus_1: Swift.Int, - _hyphen_1: Swift.Int, - laugh: Swift.Int, - confused: Swift.Int, - heart: Swift.Int, - hooray: Swift.Int, - eyes: Swift.Int, - rocket: Swift.Int - ) { - self.url = url - self.totalCount = totalCount - self._plus_1 = _plus_1 - self._hyphen_1 = _hyphen_1 - self.laugh = laugh - self.confused = confused - self.heart = heart - self.hooray = hooray - self.eyes = eyes - self.rocket = rocket - } - public enum CodingKeys: String, CodingKey { - case url - case totalCount = "total_count" - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh - case confused - case heart - case hooray - case eyes - case rocket - } - } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { /// Enable or disable GitHub Advanced Security for the repository. @@ -2783,6 +1810,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2793,6 +1921,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2800,7 +1931,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2809,6 +1943,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2818,6 +1955,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -2960,6 +2100,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -3095,10 +2250,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3176,6 +2331,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3265,6 +2423,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3354,6 +2515,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3444,6 +2608,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4395,254 +3562,24 @@ public enum Components { case enterpriseId = "enterprise_id" } } - /// A team discussion is a persistent record of a free-form conversation within a team. + /// Team Membership /// - /// - Remark: Generated from `#/components/schemas/team-discussion`. - public struct TeamDiscussion: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team-discussion/author`. - public var author: Components.Schemas.NullableSimpleUser? - /// The main text of the discussion. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion/body`. - public var body: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/body_html`. - public var bodyHtml: Swift.String - /// The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion/body_version`. - public var bodyVersion: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/comments_count`. - public var commentsCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/team-discussion/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/team-discussion/last_edited_at`. - public var lastEditedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/team-discussion/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/node_id`. - public var nodeId: Swift.String - /// The unique sequence number of a team discussion. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion/number`. - public var number: Swift.Int - /// Whether or not this discussion should be pinned for easy retrieval. + /// - Remark: Generated from `#/components/schemas/team-membership`. + public struct TeamMembership: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team-membership/url`. + public var url: Swift.String + /// The role of the user in the team. /// - /// - Remark: Generated from `#/components/schemas/team-discussion/pinned`. - public var pinned: Swift.Bool - /// Whether or not this discussion should be restricted to team members and organization owners. + /// - Remark: Generated from `#/components/schemas/team-membership/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" + } + /// The role of the user in the team. /// - /// - Remark: Generated from `#/components/schemas/team-discussion/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team-discussion/team_url`. - public var teamUrl: Swift.String - /// The title of the discussion. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/team-discussion/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// Creates a new `TeamDiscussion`. - /// - /// - Parameters: - /// - author: - /// - body: The main text of the discussion. - /// - bodyHtml: - /// - bodyVersion: The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - /// - commentsCount: - /// - commentsUrl: - /// - createdAt: - /// - lastEditedAt: - /// - htmlUrl: - /// - nodeId: - /// - number: The unique sequence number of a team discussion. - /// - pinned: Whether or not this discussion should be pinned for easy retrieval. - /// - _private: Whether or not this discussion should be restricted to team members and organization owners. - /// - teamUrl: - /// - title: The title of the discussion. - /// - updatedAt: - /// - url: - /// - reactions: - public init( - author: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String, - bodyHtml: Swift.String, - bodyVersion: Swift.String, - commentsCount: Swift.Int, - commentsUrl: Swift.String, - createdAt: Foundation.Date, - lastEditedAt: Foundation.Date? = nil, - htmlUrl: Swift.String, - nodeId: Swift.String, - number: Swift.Int, - pinned: Swift.Bool, - _private: Swift.Bool, - teamUrl: Swift.String, - title: Swift.String, - updatedAt: Foundation.Date, - url: Swift.String, - reactions: Components.Schemas.ReactionRollup? = nil - ) { - self.author = author - self.body = body - self.bodyHtml = bodyHtml - self.bodyVersion = bodyVersion - self.commentsCount = commentsCount - self.commentsUrl = commentsUrl - self.createdAt = createdAt - self.lastEditedAt = lastEditedAt - self.htmlUrl = htmlUrl - self.nodeId = nodeId - self.number = number - self.pinned = pinned - self._private = _private - self.teamUrl = teamUrl - self.title = title - self.updatedAt = updatedAt - self.url = url - self.reactions = reactions - } - public enum CodingKeys: String, CodingKey { - case author - case body - case bodyHtml = "body_html" - case bodyVersion = "body_version" - case commentsCount = "comments_count" - case commentsUrl = "comments_url" - case createdAt = "created_at" - case lastEditedAt = "last_edited_at" - case htmlUrl = "html_url" - case nodeId = "node_id" - case number - case pinned - case _private = "private" - case teamUrl = "team_url" - case title - case updatedAt = "updated_at" - case url - case reactions - } - } - /// A reply to a discussion within a team. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion-comment`. - public struct TeamDiscussionComment: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/author`. - public var author: Components.Schemas.NullableSimpleUser? - /// The main text of the comment. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/body`. - public var body: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/body_html`. - public var bodyHtml: Swift.String - /// The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/body_version`. - public var bodyVersion: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/last_edited_at`. - public var lastEditedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/discussion_url`. - public var discussionUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/node_id`. - public var nodeId: Swift.String - /// The unique sequence number of a team discussion comment. - /// - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team-discussion-comment/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// Creates a new `TeamDiscussionComment`. - /// - /// - Parameters: - /// - author: - /// - body: The main text of the comment. - /// - bodyHtml: - /// - bodyVersion: The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - /// - createdAt: - /// - lastEditedAt: - /// - discussionUrl: - /// - htmlUrl: - /// - nodeId: - /// - number: The unique sequence number of a team discussion comment. - /// - updatedAt: - /// - url: - /// - reactions: - public init( - author: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String, - bodyHtml: Swift.String, - bodyVersion: Swift.String, - createdAt: Foundation.Date, - lastEditedAt: Foundation.Date? = nil, - discussionUrl: Swift.String, - htmlUrl: Swift.String, - nodeId: Swift.String, - number: Swift.Int, - updatedAt: Foundation.Date, - url: Swift.String, - reactions: Components.Schemas.ReactionRollup? = nil - ) { - self.author = author - self.body = body - self.bodyHtml = bodyHtml - self.bodyVersion = bodyVersion - self.createdAt = createdAt - self.lastEditedAt = lastEditedAt - self.discussionUrl = discussionUrl - self.htmlUrl = htmlUrl - self.nodeId = nodeId - self.number = number - self.updatedAt = updatedAt - self.url = url - self.reactions = reactions - } - public enum CodingKeys: String, CodingKey { - case author - case body - case bodyHtml = "body_html" - case bodyVersion = "body_version" - case createdAt = "created_at" - case lastEditedAt = "last_edited_at" - case discussionUrl = "discussion_url" - case htmlUrl = "html_url" - case nodeId = "node_id" - case number - case updatedAt = "updated_at" - case url - case reactions - } - } - /// Team Membership - /// - /// - Remark: Generated from `#/components/schemas/team-membership`. - public struct TeamMembership: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team-membership/url`. - public var url: Swift.String - /// The role of the user in the team. - /// - /// - Remark: Generated from `#/components/schemas/team-membership/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case member = "member" - case maintainer = "maintainer" - } - /// The role of the user in the team. - /// - /// - Remark: Generated from `#/components/schemas/team-membership/role`. - public var role: Components.Schemas.TeamMembership.RolePayload - /// The state of the user's membership in the team. + /// - Remark: Generated from `#/components/schemas/team-membership/role`. + public var role: Components.Schemas.TeamMembership.RolePayload + /// The state of the user's membership in the team. /// /// - Remark: Generated from `#/components/schemas/team-membership/state`. @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -4674,148 +3611,6 @@ public enum Components { case state } } - /// A team's access to a project. - /// - /// - Remark: Generated from `#/components/schemas/team-project`. - public struct TeamProject: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team-project/owner_url`. - public var ownerUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/columns_url`. - public var columnsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team-project/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/team-project/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/team-project/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/creator`. - public var creator: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/team-project/created_at`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/components/schemas/team-project/updated_at`. - public var updatedAt: Swift.String - /// The organization permission for this project. Only present when owner is an organization. - /// - /// - Remark: Generated from `#/components/schemas/team-project/organization_permission`. - public var organizationPermission: Swift.String? - /// Whether the project is private or not. Only present when owner is an organization. - /// - /// - Remark: Generated from `#/components/schemas/team-project/private`. - public var _private: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/team-project/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team-project/permissions/read`. - public var read: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team-project/permissions/write`. - public var write: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team-project/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `PermissionsPayload`. - /// - /// - Parameters: - /// - read: - /// - write: - /// - admin: - public init( - read: Swift.Bool, - write: Swift.Bool, - admin: Swift.Bool - ) { - self.read = read - self.write = write - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case read - case write - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team-project/permissions`. - public var permissions: Components.Schemas.TeamProject.PermissionsPayload - /// Creates a new `TeamProject`. - /// - /// - Parameters: - /// - ownerUrl: - /// - url: - /// - htmlUrl: - /// - columnsUrl: - /// - id: - /// - nodeId: - /// - name: - /// - body: - /// - number: - /// - state: - /// - creator: - /// - createdAt: - /// - updatedAt: - /// - organizationPermission: The organization permission for this project. Only present when owner is an organization. - /// - _private: Whether the project is private or not. Only present when owner is an organization. - /// - permissions: - public init( - ownerUrl: Swift.String, - url: Swift.String, - htmlUrl: Swift.String, - columnsUrl: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - name: Swift.String, - body: Swift.String? = nil, - number: Swift.Int, - state: Swift.String, - creator: Components.Schemas.SimpleUser, - createdAt: Swift.String, - updatedAt: Swift.String, - organizationPermission: Swift.String? = nil, - _private: Swift.Bool? = nil, - permissions: Components.Schemas.TeamProject.PermissionsPayload - ) { - self.ownerUrl = ownerUrl - self.url = url - self.htmlUrl = htmlUrl - self.columnsUrl = columnsUrl - self.id = id - self.nodeId = nodeId - self.name = name - self.body = body - self.number = number - self.state = state - self.creator = creator - self.createdAt = createdAt - self.updatedAt = updatedAt - self.organizationPermission = organizationPermission - self._private = _private - self.permissions = permissions - } - public enum CodingKeys: String, CodingKey { - case ownerUrl = "owner_url" - case url - case htmlUrl = "html_url" - case columnsUrl = "columns_url" - case id - case nodeId = "node_id" - case name - case body - case number - case state - case creator - case createdAt = "created_at" - case updatedAt = "updated_at" - case organizationPermission = "organization_permission" - case _private = "private" - case permissions - } - } /// A team's access to a repository. /// /// - Remark: Generated from `#/components/schemas/team-repository`. @@ -5445,13 +4240,6 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// /// - Remark: Generated from `#/components/parameters/per-page`. @@ -5480,18 +4268,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/components/parameters/discussion-number`. - public typealias DiscussionNumber = Swift.Int - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/components/parameters/comment-number`. - public typealias CommentNumber = Swift.Int - /// The unique identifier of the project. + /// Filter team results by their type. For more information, see "[What kind of team should I use?](https://docs.github.com/enterprise-cloud@latest/admin/concepts/enterprise-fundamentals/teams-in-an-enterprise#what-kind-of-team-should-i-use)" /// - /// - Remark: Generated from `#/components/parameters/project-id`. - public typealias ProjectId = Swift.Int + /// - Remark: Generated from `#/components/parameters/team-type`. + @frozen public enum TeamType: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case enterprise = "enterprise" + case organization = "organization" + } /// The unique identifier of the team. /// /// - Remark: Generated from `#/components/parameters/team-id`. @@ -5589,6 +4373,10 @@ public enum Components { self.body = body } } + public struct EnterpriseTeamUnsupported: Sendable, Hashable { + /// Creates a new `EnterpriseTeamUnsupported`. + public init() {} + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { @@ -5633,17 +4421,30 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/GET/query/page`. public var page: Components.Parameters.Page? + /// - Remark: Generated from `#/components/parameters/team-type`. + @frozen public enum TeamType: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case enterprise = "enterprise" + case organization = "organization" + } + /// Filter team results by their type. For more information, see "[What kind of team should I use?](https://docs.github.com/enterprise-cloud@latest/admin/concepts/enterprise-fundamentals/teams-in-an-enterprise#what-kind-of-team-should-i-use)" + /// + /// - Remark: Generated from `#/paths/orgs/{org}/teams/GET/query/team_type`. + public var teamType: Components.Parameters.TeamType? /// 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)." + /// - teamType: Filter team results by their type. For more information, see "[What kind of team should I use?](https://docs.github.com/enterprise-cloud@latest/admin/concepts/enterprise-fundamentals/teams-in-an-enterprise#what-kind-of-team-should-i-use)" public init( perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + page: Components.Parameters.Page? = nil, + teamType: Components.Parameters.TeamType? = nil ) { self.perPage = perPage self.page = page + self.teamType = teamType } } public var query: Operations.TeamsList.Input.Query @@ -6722,35 +5523,64 @@ public enum Operations { } } } + /// Unprocessable entity if you attempt to modify an enterprise team at the organization level. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/delete(teams/delete-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.EnterpriseTeamUnsupported) + /// Unprocessable entity if you attempt to modify an enterprise team at the organization level. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/delete(teams/delete-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// 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.EnterpriseTeamUnsupported { + 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) } } - /// List discussions + /// List pending team invitations /// - /// List all discussions on a team's page. + /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/get(teams/list-discussions-in-org)`. - public enum TeamsListDiscussionsInOrg { - public static let id: Swift.String = "teams/list-discussions-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)`. + public enum TeamsListPendingInvitationsInOrg { + public static let id: Swift.String = "teams/list-pending-invitations-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// @@ -6765,62 +5595,43 @@ public enum Operations { self.teamSlug = teamSlug } } - public var path: Operations.TeamsListDiscussionsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/query`. + public var path: Operations.TeamsListPendingInvitationsInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/query/direction`. - public var direction: Components.Parameters.Direction? /// 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}/teams/{team_slug}/discussions/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/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}/teams/{team_slug}/discussions/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/query/page`. public var page: Components.Parameters.Page? - /// Pinned discussions only filter - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/query/pinned`. - public var pinned: Swift.String? /// Creates a new `Query`. /// /// - Parameters: - /// - direction: The direction to sort the results by. /// - 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)." - /// - pinned: Pinned discussions only filter public init( - direction: Components.Parameters.Direction? = nil, perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - pinned: Swift.String? = nil + page: Components.Parameters.Page? = nil ) { - self.direction = direction self.perPage = perPage self.page = page - self.pinned = pinned } } - public var query: Operations.TeamsListDiscussionsInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/header`. + public var query: Operations.TeamsListPendingInvitationsInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/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.TeamsListDiscussionsInOrg.Input.Headers + public var headers: Operations.TeamsListPendingInvitationsInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -6828,9 +5639,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.TeamsListDiscussionsInOrg.Input.Path, - query: Operations.TeamsListDiscussionsInOrg.Input.Query = .init(), - headers: Operations.TeamsListDiscussionsInOrg.Input.Headers = .init() + path: Operations.TeamsListPendingInvitationsInOrg.Input.Path, + query: Operations.TeamsListPendingInvitationsInOrg.Input.Query = .init(), + headers: Operations.TeamsListPendingInvitationsInOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -6839,9 +5650,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -6852,16 +5663,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.TeamsListDiscussionsInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/responses/200/content`. + public var headers: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamDiscussion]) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) /// 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.TeamDiscussion] { + public var json: [Components.Schemas.OrganizationInvitation] { get throws { switch self { case let .json(body): @@ -6871,15 +5682,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsListDiscussionsInOrg.Output.Ok.Body + public var body: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.TeamsListDiscussionsInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListDiscussionsInOrg.Output.Ok.Body + headers: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Headers = .init(), + body: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -6887,15 +5698,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/get(teams/list-discussions-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListDiscussionsInOrg.Output.Ok) + case ok(Operations.TeamsListPendingInvitationsInOrg.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.TeamsListDiscussionsInOrg.Output.Ok { + public var ok: Operations.TeamsListPendingInvitationsInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -6908,21 +5719,52 @@ public enum Operations { } } } - /// Undocumented response. + /// Unprocessable entity if you attempt to modify an enterprise team at the organization level. /// - /// 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}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.EnterpriseTeamUnsupported) + /// Unprocessable entity if you attempt to modify an enterprise team at the organization level. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// 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.EnterpriseTeamUnsupported { + 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 { @@ -6939,31 +5781,26 @@ public enum Operations { } } } - /// Create a discussion - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// List team members /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. + /// Team members will include the members of child teams. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// To list members in a team, the team must be visible to the authenticated user. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/post(teams/create-discussion-in-org)`. - public enum TeamsCreateDiscussionInOrg { - public static let id: Swift.String = "teams/create-discussion-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)`. + public enum TeamsListMembersInOrg { + public static let id: Swift.String = "teams/list-members-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// @@ -6978,87 +5815,97 @@ public enum Operations { self.teamSlug = teamSlug } } - public var path: Operations.TeamsCreateDiscussionInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/header`. + public var path: Operations.TeamsListMembersInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" + case all = "all" + } + /// Filters members returned by their role in the team. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query/role`. + public var role: Operations.TeamsListMembersInOrg.Input.Query.RolePayload? + /// 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}/teams/{team_slug}/members/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}/teams/{team_slug}/members/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - role: Filters members returned by their role in the team. + /// - 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( + role: Operations.TeamsListMembersInOrg.Input.Query.RolePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.role = role + self.perPage = perPage + self.page = page + } + } + public var query: Operations.TeamsListMembersInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/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.TeamsCreateDiscussionInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion post's title. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody/json/title`. - public var title: Swift.String - /// The discussion post's body text. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody/json/body`. - public var body: Swift.String - /// Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody/json/private`. - public var _private: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - title: The discussion post's title. - /// - body: The discussion post's body text. - /// - _private: Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - public init( - title: Swift.String, - body: Swift.String, - _private: Swift.Bool? = nil - ) { - self.title = title - self.body = body - self._private = _private - } - public enum CodingKeys: String, CodingKey { - case title - case body - case _private = "private" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/requestBody/content/application\/json`. - case json(Operations.TeamsCreateDiscussionInOrg.Input.Body.JsonPayload) - } - public var body: Operations.TeamsCreateDiscussionInOrg.Input.Body + public var headers: Operations.TeamsListMembersInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.TeamsCreateDiscussionInOrg.Input.Path, - headers: Operations.TeamsCreateDiscussionInOrg.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionInOrg.Input.Body + path: Operations.TeamsListMembersInOrg.Input.Path, + query: Operations.TeamsListMembersInOrg.Input.Query = .init(), + headers: Operations.TeamsListMembersInOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/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.TeamsListMembersInOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.TeamDiscussion { + public var json: [Components.Schemas.SimpleUser] { get throws { switch self { case let .json(body): @@ -7068,33 +5915,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsCreateDiscussionInOrg.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.TeamsListMembersInOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.TeamsCreateDiscussionInOrg.Output.Created.Body) { + public init( + headers: Operations.TeamsListMembersInOrg.Output.Ok.Headers = .init(), + body: Operations.TeamsListMembersInOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/post(teams/create-discussion-in-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.TeamsCreateDiscussionInOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.TeamsListMembersInOrg.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.TeamsCreateDiscussionInOrg.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.TeamsListMembersInOrg.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 ) } @@ -7131,71 +5983,76 @@ public enum Operations { } } } - /// Get a discussion + /// Get team membership for a user + /// + /// Team members will include the members of child teams. + /// + /// To get a user's membership with a team, the team must be visible to the authenticated user. /// - /// Get a specific discussion on a team's page. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > The response contains the `state` of the membership and the member's `role`. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/get(teams/get-discussion-in-org)`. - public enum TeamsGetDiscussionInOrg { - public static let id: Swift.String = "teams/get-discussion-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)`. + public enum TeamsGetMembershipForUserInOrg { + public static let id: Swift.String = "teams/get-membership-for-user-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + username: Components.Parameters.Username ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.username = username } } - public var path: Operations.TeamsGetDiscussionInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/header`. + public var path: Operations.TeamsGetMembershipForUserInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/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.TeamsGetDiscussionInOrg.Input.Headers + public var headers: Operations.TeamsGetMembershipForUserInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.TeamsGetDiscussionInOrg.Input.Path, - headers: Operations.TeamsGetDiscussionInOrg.Input.Headers = .init() + path: Operations.TeamsGetMembershipForUserInOrg.Input.Path, + headers: Operations.TeamsGetMembershipForUserInOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -7203,15 +6060,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.TeamMembership) /// 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.TeamDiscussion { + public var json: Components.Schemas.TeamMembership { get throws { switch self { case let .json(body): @@ -7221,26 +6078,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsGetDiscussionInOrg.Output.Ok.Body + public var body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsGetDiscussionInOrg.Output.Ok.Body) { + public init(body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/get(teams/get-discussion-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetDiscussionInOrg.Output.Ok) + case ok(Operations.TeamsGetMembershipForUserInOrg.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.TeamsGetDiscussionInOrg.Output.Ok { + public var ok: Operations.TeamsGetMembershipForUserInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -7253,6 +6110,41 @@ public enum Operations { } } } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// if user has no team membership + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.TeamsGetMembershipForUserInOrg.Output.NotFound) + /// if user has no team membership + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.TeamsGetMembershipForUserInOrg.Output.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. @@ -7284,96 +6176,100 @@ public enum Operations { } } } - /// Update a discussion + /// Add or update team membership for a user + /// + /// Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// + /// An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + /// + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/patch(teams/update-discussion-in-org)`. - public enum TeamsUpdateDiscussionInOrg { - public static let id: Swift.String = "teams/update-discussion-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)`. + public enum TeamsAddOrUpdateMembershipForUserInOrg { + public static let id: Swift.String = "teams/add-or-update-membership-for-user-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + username: Components.Parameters.Username ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.username = username } } - public var path: Operations.TeamsUpdateDiscussionInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/header`. + public var path: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/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.TeamsUpdateDiscussionInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/requestBody`. + public var headers: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion post's title. + /// The role that this user should have in the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/requestBody/json/title`. - public var title: Swift.String? - /// The discussion post's body text. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" + } + /// The role that this user should have in the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/requestBody/json/body`. - public var body: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json/role`. + public var role: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload.RolePayload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - title: The discussion post's title. - /// - body: The discussion post's body text. - public init( - title: Swift.String? = nil, - body: Swift.String? = nil - ) { - self.title = title - self.body = body + /// - role: The role that this user should have in the team. + public init(role: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload.RolePayload? = nil) { + self.role = role } public enum CodingKeys: String, CodingKey { - case title - case body + case role } } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.TeamsUpdateDiscussionInOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload) } - public var body: Operations.TeamsUpdateDiscussionInOrg.Input.Body? + public var body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -7381,9 +6277,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.TeamsUpdateDiscussionInOrg.Input.Path, - headers: Operations.TeamsUpdateDiscussionInOrg.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionInOrg.Input.Body? = nil + path: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Path, + headers: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Headers = .init(), + body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body? = nil ) { self.path = path self.headers = headers @@ -7392,15 +6288,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.TeamMembership) /// 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.TeamDiscussion { + public var json: Components.Schemas.TeamMembership { get throws { switch self { case let .json(body): @@ -7410,26 +6306,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsUpdateDiscussionInOrg.Output.Ok.Body + public var body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateDiscussionInOrg.Output.Ok.Body) { + public init(body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/patch(teams/update-discussion-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsUpdateDiscussionInOrg.Output.Ok) + case ok(Operations.TeamsAddOrUpdateMembershipForUserInOrg.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.TeamsUpdateDiscussionInOrg.Output.Ok { + public var ok: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -7442,6 +6338,76 @@ public enum Operations { } } } + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Forbidden if team synchronization is set up + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Forbidden) + /// Forbidden if team synchronization is set up + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// 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.TeamsAddOrUpdateMembershipForUserInOrg.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Unprocessable Entity if you attempt to add an organization to a team + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.UnprocessableContent) + /// Unprocessable Entity if you attempt to add an organization to a team + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -7473,56 +6439,59 @@ public enum Operations { } } } - /// Delete a discussion + /// Remove team membership for a user + /// + /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. /// - /// Delete a discussion from a team's page. + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)`. - public enum TeamsDeleteDiscussionInOrg { - public static let id: Swift.String = "teams/delete-discussion-in-org" + /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)`. + public enum TeamsRemoveMembershipForUserInOrg { + public static let id: Swift.String = "teams/remove-membership-for-user-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/DELETE/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + username: Components.Parameters.Username ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.username = username } } - public var path: Operations.TeamsDeleteDiscussionInOrg.Input.Path + public var path: Operations.TeamsRemoveMembershipForUserInOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.TeamsDeleteDiscussionInOrg.Input.Path) { + public init(path: Operations.TeamsRemoveMembershipForUserInOrg.Input.Path) { self.path = path } } @@ -7533,13 +6502,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsDeleteDiscussionInOrg.Output.NoContent) + case noContent(Operations.TeamsRemoveMembershipForUserInOrg.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/delete(teams/delete-discussion-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -7549,7 +6518,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsDeleteDiscussionInOrg.Output.NoContent { + public var noContent: Operations.TeamsRemoveMembershipForUserInOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -7562,105 +6531,119 @@ public enum Operations { } } } + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Forbidden if team synchronization is set up + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.TeamsRemoveMembershipForUserInOrg.Output.Forbidden) + /// Forbidden if team synchronization is set up + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// 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.TeamsRemoveMembershipForUserInOrg.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List discussion comments + /// List team repositories /// - /// List all comments on a team discussion. + /// Lists a team's repositories visible to the authenticated user. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-in-org)`. - public enum TeamsListDiscussionCommentsInOrg { - public static let id: Swift.String = "teams/list-discussion-comments-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. + public enum TeamsListReposInOrg { + public static let id: Swift.String = "teams/list-repos-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. public init( org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + teamSlug: Components.Parameters.TeamSlug ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber } } - public var path: Operations.TeamsListDiscussionCommentsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/query`. + public var path: Operations.TeamsListReposInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/query/direction`. - public var direction: Components.Parameters.Direction? /// 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}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/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}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - direction: The direction to sort the results by. /// - 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( - direction: Components.Parameters.Direction? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { - self.direction = direction self.perPage = perPage self.page = page } } - public var query: Operations.TeamsListDiscussionCommentsInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/header`. + public var query: Operations.TeamsListReposInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/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.TeamsListDiscussionCommentsInOrg.Input.Headers + public var headers: Operations.TeamsListReposInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -7668,9 +6651,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.TeamsListDiscussionCommentsInOrg.Input.Path, - query: Operations.TeamsListDiscussionCommentsInOrg.Input.Query = .init(), - headers: Operations.TeamsListDiscussionCommentsInOrg.Input.Headers = .init() + path: Operations.TeamsListReposInOrg.Input.Path, + query: Operations.TeamsListReposInOrg.Input.Query = .init(), + headers: Operations.TeamsListReposInOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -7679,9 +6662,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7692,16 +6675,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.TeamsListDiscussionCommentsInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/responses/200/content`. + public var headers: Operations.TeamsListReposInOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamDiscussionComment]) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/content/application\/json`. + case json([Components.Schemas.MinimalRepository]) /// 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.TeamDiscussionComment] { + public var json: [Components.Schemas.MinimalRepository] { get throws { switch self { case let .json(body): @@ -7711,15 +6694,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsListDiscussionCommentsInOrg.Output.Ok.Body + public var body: Operations.TeamsListReposInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.TeamsListDiscussionCommentsInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListDiscussionCommentsInOrg.Output.Ok.Body + headers: Operations.TeamsListReposInOrg.Output.Ok.Headers = .init(), + body: Operations.TeamsListReposInOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7727,15 +6710,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListDiscussionCommentsInOrg.Output.Ok) + case ok(Operations.TeamsListReposInOrg.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.TeamsListDiscussionCommentsInOrg.Output.Ok { + public var ok: Operations.TeamsListReposInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -7779,115 +6762,98 @@ public enum Operations { } } } - /// Create a discussion comment + /// Check team permissions for a repository + /// + /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. /// - /// Creates a new comment on a team discussion. + /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + /// If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > [!NOTE] + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// - Remark: HTTP `POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-in-org)`. - public enum TeamsCreateDiscussionCommentInOrg { - public static let id: Swift.String = "teams/create-discussion-comment-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)`. + public enum TeamsCheckPermissionsForRepoInOrg { + public static let id: Swift.String = "teams/check-permissions-for-repo-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/repo`. + public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber + self.owner = owner + self.repo = repo } } - public var path: Operations.TeamsCreateDiscussionCommentInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/header`. + public var path: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/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.TeamsCreateDiscussionCommentInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion comment's body text. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The discussion comment's body text. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/requestBody/content/application\/json`. - case json(Operations.TeamsCreateDiscussionCommentInOrg.Input.Body.JsonPayload) - } - public var body: Operations.TeamsCreateDiscussionCommentInOrg.Input.Body + public var headers: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.TeamsCreateDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsCreateDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionCommentInOrg.Input.Body + path: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Path, + headers: Operations.TeamsCheckPermissionsForRepoInOrg.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}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/POST/responses/201/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.TeamRepository) /// 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.TeamDiscussionComment { + public var json: Components.Schemas.TeamRepository { get throws { switch self { case let .json(body): @@ -7897,33 +6863,103 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsCreateDiscussionCommentInOrg.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.TeamsCheckPermissionsForRepoInOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsCreateDiscussionCommentInOrg.Output.Created.Body) { + public init(body: Operations.TeamsCheckPermissionsForRepoInOrg.Output.Ok.Body) { self.body = body } } - /// Response + /// Alternative response with repository permissions /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-in-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.TeamsCreateDiscussionCommentInOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.TeamsCheckPermissionsForRepoInOrg.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.TeamsCreateDiscussionCommentInOrg.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.TeamsCheckPermissionsForRepoInOrg.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 + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.TeamsCheckPermissionsForRepoInOrg.Output.NoContent) + /// Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.TeamsCheckPermissionsForRepoInOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if team does not have permission for the repository + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.TeamsCheckPermissionsForRepoInOrg.Output.NotFound) + /// Not Found if team does not have permission for the repository + /// + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.TeamsCheckPermissionsForRepoInOrg.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", response: self ) } @@ -7960,130 +6996,125 @@ public enum Operations { } } } - /// Get a discussion comment + /// Add or update team repository permissions /// - /// Get a specific comment on a team discussion. + /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. + /// For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-in-org)`. - public enum TeamsGetDiscussionCommentInOrg { - public static let id: Swift.String = "teams/get-discussion-comment-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)`. + public enum TeamsAddOrUpdateRepoPermissionsInOrg { + public static let id: Swift.String = "teams/add-or-update-repo-permissions-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/repo`. + public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber + self.owner = owner + self.repo = repo } } - public var path: Operations.TeamsGetDiscussionCommentInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/json/permission`. + public var permission: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - permission: The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + public init(permission: Swift.String? = nil) { + self.permission = permission + } + public enum CodingKeys: String, CodingKey { + case permission + } } + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/content/application\/json`. + case json(Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body.JsonPayload) } - public var headers: Operations.TeamsGetDiscussionCommentInOrg.Input.Headers + public var body: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.TeamsGetDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsGetDiscussionCommentInOrg.Input.Headers = .init() + path: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Path, + body: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body? = nil ) { self.path = path - self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) - /// 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.TeamDiscussionComment { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsGetDiscussionCommentInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsGetDiscussionCommentInOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetDiscussionCommentInOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.TeamsGetDiscussionCommentInOrg.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.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 ) } @@ -8094,275 +7125,62 @@ 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 discussion comment + /// Remove a repository from a team /// - /// Edits the body text of a discussion comment. + /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. + /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. /// - /// - Remark: HTTP `PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-in-org)`. - public enum TeamsUpdateDiscussionCommentInOrg { - public static let id: Swift.String = "teams/update-discussion-comment-in-org" + /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)`. + public enum TeamsRemoveRepoInOrg { + public static let id: Swift.String = "teams/remove-repo-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( org: Components.Parameters.Org, teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { self.org = org self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber + self.owner = owner + self.repo = repo } } - public var path: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion comment's body text. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The discussion comment's body text. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.TeamsUpdateDiscussionCommentInOrg.Input.Body.JsonPayload) - } - public var body: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Path, - headers: Operations.TeamsUpdateDiscussionCommentInOrg.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionCommentInOrg.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}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) - /// 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.TeamDiscussionComment { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsUpdateDiscussionCommentInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateDiscussionCommentInOrg.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsUpdateDiscussionCommentInOrg.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.TeamsUpdateDiscussionCommentInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a discussion comment - /// - /// Deletes a comment on a team discussion. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)`. - public enum TeamsDeleteDiscussionCommentInOrg { - public static let id: Swift.String = "teams/delete-discussion-comment-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.org = org - self.teamSlug = teamSlug - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.TeamsDeleteDiscussionCommentInOrg.Input.Path + public var path: Operations.TeamsRemoveRepoInOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.TeamsDeleteDiscussionCommentInOrg.Input.Path) { + public init(path: Operations.TeamsRemoveRepoInOrg.Input.Path) { self.path = path } } @@ -8373,13 +7191,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsDeleteDiscussionCommentInOrg.Output.NoContent) + case noContent(Operations.TeamsRemoveRepoInOrg.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -8389,7 +7207,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsDeleteDiscussionCommentInOrg.Output.NoContent { + public var noContent: Operations.TeamsRemoveRepoInOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -8408,27 +7226,27 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List pending team invitations + /// List child teams /// - /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + /// Lists the child teams of the team specified by `{team_slug}`. /// /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. + /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)`. - public enum TeamsListPendingInvitationsInOrg { - public static let id: Swift.String = "teams/list-pending-invitations-in-org" + /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)`. + public enum TeamsListChildInOrg { + public static let id: Swift.String = "teams/list-child-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path/org`. public var org: Components.Parameters.Org /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/path/team_slug`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path/team_slug`. public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// @@ -8443,16 +7261,16 @@ public enum Operations { self.teamSlug = teamSlug } } - public var path: Operations.TeamsListPendingInvitationsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/query`. + public var path: Operations.TeamsListChildInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/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}/teams/{team_slug}/invitations/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -8467,19 +7285,19 @@ public enum Operations { self.page = page } } - public var query: Operations.TeamsListPendingInvitationsInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/header`. + public var query: Operations.TeamsListChildInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.TeamsListPendingInvitationsInOrg.Input.Headers + public var headers: Operations.TeamsListChildInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -8487,9 +7305,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.TeamsListPendingInvitationsInOrg.Input.Path, - query: Operations.TeamsListPendingInvitationsInOrg.Input.Query = .init(), - headers: Operations.TeamsListPendingInvitationsInOrg.Input.Headers = .init() + path: Operations.TeamsListChildInOrg.Input.Path, + query: Operations.TeamsListChildInOrg.Input.Query = .init(), + headers: Operations.TeamsListChildInOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -8498,9 +7316,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -8511,16 +7329,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/content`. + public var headers: Operations.TeamsListChildInOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Team]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationInvitation] { + public var json: [Components.Schemas.Team] { get throws { switch self { case let .json(body): @@ -8530,31 +7348,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Body + public var body: Operations.TeamsListChildInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListPendingInvitationsInOrg.Output.Ok.Body + headers: Operations.TeamsListChildInOrg.Output.Ok.Headers = .init(), + body: Operations.TeamsListChildInOrg.Output.Ok.Body ) { self.headers = headers self.body = body } } - /// Response + /// if child teams exist /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/invitations/get(teams/list-pending-invitations-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListPendingInvitationsInOrg.Output.Ok) + case ok(Operations.TeamsListChildInOrg.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.TeamsListPendingInvitationsInOrg.Output.Ok { + public var ok: Operations.TeamsListChildInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -8598,131 +7416,67 @@ public enum Operations { } } } - /// List team members - /// - /// Team members will include the members of child teams. + /// Get a team (Legacy) /// - /// To list members in a team, the team must be visible to the authenticated user. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)`. - public enum TeamsListMembersInOrg { - public static let id: Swift.String = "teams/list-members-in-org" + /// - Remark: HTTP `GET /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. + public enum TeamsGetLegacy { + public static let id: Swift.String = "teams/get-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug + /// - Remark: Generated from `#/paths/teams/{team_id}/GET/path/team_id`. + public var teamId: Components.Parameters.TeamId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug - ) { - self.org = org - self.teamSlug = teamSlug + /// - teamId: The unique identifier of the team. + public init(teamId: Components.Parameters.TeamId) { + self.teamId = teamId } } - public var path: Operations.TeamsListMembersInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case member = "member" - case maintainer = "maintainer" - case all = "all" - } - /// Filters members returned by their role in the team. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/query/role`. - public var role: Operations.TeamsListMembersInOrg.Input.Query.RolePayload? - /// 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}/teams/{team_slug}/members/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}/teams/{team_slug}/members/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - role: Filters members returned by their role in the team. - /// - 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( - role: Operations.TeamsListMembersInOrg.Input.Query.RolePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.role = role - self.perPage = perPage - self.page = page - } - } - public var query: Operations.TeamsListMembersInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/header`. + public var path: Operations.TeamsGetLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_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.TeamsListMembersInOrg.Input.Headers + public var headers: Operations.TeamsGetLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.TeamsListMembersInOrg.Input.Path, - query: Operations.TeamsListMembersInOrg.Input.Query = .init(), - headers: Operations.TeamsListMembersInOrg.Input.Headers = .init() + path: Operations.TeamsGetLegacy.Input.Path, + headers: Operations.TeamsGetLegacy.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}/teams/{team_slug}/members/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/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.TeamsListMembersInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/teams/{team_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/teams/{team_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.TeamFull) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: Components.Schemas.TeamFull { get throws { switch self { case let .json(body): @@ -8732,31 +7486,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsListMembersInOrg.Output.Ok.Body + public var body: Operations.TeamsGetLegacy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListMembersInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListMembersInOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.TeamsGetLegacy.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/members/get(teams/list-members-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListMembersInOrg.Output.Ok) + case ok(Operations.TeamsGetLegacy.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.TeamsListMembersInOrg.Output.Ok { + public var ok: Operations.TeamsGetLegacy.Output.Ok { get throws { switch self { case let .ok(response): @@ -8769,6 +7518,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)/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. @@ -8800,293 +7572,149 @@ public enum Operations { } } } - /// Get team membership for a user - /// - /// Team members will include the members of child teams. + /// Update a team (Legacy) /// - /// To get a user's membership with a team, the team must be visible to the authenticated user. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. + /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// /// > [!NOTE] - /// > The response contains the `state` of the membership and the member's `role`. - /// - /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). + /// > With nested teams, the `privacy` for parent teams cannot be `secret`. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)`. - public enum TeamsGetMembershipForUserInOrg { - public static let id: Swift.String = "teams/get-membership-for-user-in-org" + /// - Remark: HTTP `PATCH /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)`. + public enum TeamsUpdateLegacy { + public static let id: Swift.String = "teams/update-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The handle for the GitHub user account. + /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/path/team_id`. + public var teamId: Components.Parameters.TeamId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - username: Components.Parameters.Username - ) { - self.org = org - self.teamSlug = teamSlug - self.username = username + /// - teamId: The unique identifier of the team. + public init(teamId: Components.Parameters.TeamId) { + self.teamId = teamId } } - public var path: Operations.TeamsGetMembershipForUserInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/header`. + public var path: Operations.TeamsUpdateLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_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.TeamsGetMembershipForUserInOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsGetMembershipForUserInOrg.Input.Path, - headers: Operations.TeamsGetMembershipForUserInOrg.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}/teams/{team_slug}/memberships/{username}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamMembership) - /// The associated value of the enum case if `self` is `.json`. + public var headers: Operations.TeamsUpdateLegacy.Input.Headers + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the team. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.TeamMembership { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsGetMembershipForUserInOrg.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetMembershipForUserInOrg.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.TeamsGetMembershipForUserInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// The description of the team. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: + /// **For a non-nested team:** + /// * `secret` - only visible to organization owners and members of this team. + /// * `closed` - visible to all members of this organization. + /// **For a parent or child team:** + /// * `closed` - visible to all members of this organization. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/privacy`. + @frozen public enum PrivacyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case secret = "secret" + case closed = "closed" } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// if user has no team membership - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsGetMembershipForUserInOrg.Output.NotFound) - /// if user has no team membership - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/get(teams/get-membership-for-user-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsGetMembershipForUserInOrg.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + /// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: + /// **For a non-nested team:** + /// * `secret` - only visible to organization owners and members of this team. + /// * `closed` - visible to all members of this organization. + /// **For a parent or child team:** + /// * `closed` - visible to all members of this organization. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/privacy`. + public var privacy: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PrivacyPayload? + /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/notification_setting`. + @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notificationsEnabled = "notifications_enabled" + case notificationsDisabled = "notifications_disabled" } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Add or update team membership for a user - /// - /// Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. - /// - /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)`. - public enum TeamsAddOrUpdateMembershipForUserInOrg { - public static let id: Swift.String = "teams/add-or-update-membership-for-user-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - username: Components.Parameters.Username - ) { - self.org = org - self.teamSlug = teamSlug - self.username = username - } - } - public var path: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The role that this user should have in the team. + /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case member = "member" - case maintainer = "maintainer" + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/notification_setting`. + public var notificationSetting: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.NotificationSettingPayload? + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. + @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case push = "push" + case admin = "admin" } - /// The role that this user should have in the team. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/json/role`. - public var role: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload.RolePayload? + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. + public var permission: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PermissionPayload? + /// The ID of a team to set as the parent team. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/parent_team_id`. + public var parentTeamId: Swift.Int? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - role: The role that this user should have in the team. - public init(role: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload.RolePayload? = nil) { - self.role = role + /// - name: The name of the team. + /// - description: The description of the team. + /// - privacy: The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: + /// - notificationSetting: The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: + /// - permission: **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. + /// - parentTeamId: The ID of a team to set as the parent team. + public init( + name: Swift.String, + description: Swift.String? = nil, + privacy: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PrivacyPayload? = nil, + notificationSetting: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.NotificationSettingPayload? = nil, + permission: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PermissionPayload? = nil, + parentTeamId: Swift.Int? = nil + ) { + self.name = name + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.parentTeamId = parentTeamId } public enum CodingKeys: String, CodingKey { - case role + case name + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case parentTeamId = "parent_team_id" } } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.TeamsUpdateLegacy.Input.Body.JsonPayload) } - public var body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body? + public var body: Operations.TeamsUpdateLegacy.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -9094,9 +7722,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Path, - headers: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Input.Body? = nil + path: Operations.TeamsUpdateLegacy.Input.Path, + headers: Operations.TeamsUpdateLegacy.Input.Headers = .init(), + body: Operations.TeamsUpdateLegacy.Input.Body ) { self.path = path self.headers = headers @@ -9105,15 +7733,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.TeamMembership) + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.TeamFull) /// 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.TeamMembership { + public var json: Components.Schemas.TeamFull { get throws { switch self { case let .json(body): @@ -9123,26 +7751,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body + public var body: Operations.TeamsUpdateLegacy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok.Body) { + public init(body: Operations.TeamsUpdateLegacy.Output.Ok.Body) { self.body = body } } - /// Response + /// Response when the updated information already exists /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok) + case ok(Operations.TeamsUpdateLegacy.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.TeamsAddOrUpdateMembershipForUserInOrg.Output.Ok { + public var ok: Operations.TeamsUpdateLegacy.Output.Ok { get throws { switch self { case let .ok(response): @@ -9155,64 +7783,91 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. - public init() {} - } - /// Forbidden if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.Forbidden) - /// Forbidden if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) - } - /// 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.TeamsAddOrUpdateMembershipForUserInOrg.Output.Forbidden { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/201/content/application\/json`. + case json(Components.Schemas.TeamFull) + /// 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.TeamFull { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.TeamsUpdateLegacy.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.TeamsUpdateLegacy.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.TeamsUpdateLegacy.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.TeamsUpdateLegacy.Output.Created { get throws { switch self { - case let .forbidden(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "created", response: self ) } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Unprocessable Entity if you attempt to add an organization to a team + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/422`. + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.UnprocessableContent) - /// Unprocessable Entity if you attempt to add an organization to a team + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/put(teams/add-or-update-membership-for-user-in-org)/responses/422`. + /// - 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//teams/{team_id}/patch(teams/update-legacy)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } + 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: Operations.TeamsAddOrUpdateMembershipForUserInOrg.Output.UnprocessableContent { + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { case let .unprocessableContent(response): @@ -9225,6 +7880,29 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -9256,60 +7934,58 @@ public enum Operations { } } } - /// Remove team membership for a user - /// - /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// Delete a team (Legacy) /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. + /// If you are an organization owner, deleting a parent team will delete all of its child teams as well. /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)`. - public enum TeamsRemoveMembershipForUserInOrg { - public static let id: Swift.String = "teams/remove-membership-for-user-in-org" + /// - Remark: HTTP `DELETE /teams/{team_id}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)`. + public enum TeamsDeleteLegacy { + public static let id: Swift.String = "teams/delete-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The handle for the GitHub user account. + /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/memberships/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/path/team_id`. + public var teamId: Components.Parameters.TeamId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - username: Components.Parameters.Username - ) { - self.org = org - self.teamSlug = teamSlug - self.username = username + /// - teamId: The unique identifier of the team. + public init(teamId: Components.Parameters.TeamId) { + self.teamId = teamId } } - public var path: Operations.TeamsRemoveMembershipForUserInOrg.Input.Path + public var path: Operations.TeamsDeleteLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.TeamsDeleteLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.TeamsRemoveMembershipForUserInOrg.Input.Path) { + /// - headers: + public init( + path: Operations.TeamsDeleteLegacy.Input.Path, + headers: Operations.TeamsDeleteLegacy.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -9319,13 +7995,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveMembershipForUserInOrg.Output.NoContent) + case noContent(Operations.TeamsDeleteLegacy.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -9335,7 +8011,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsRemoveMembershipForUserInOrg.Output.NoContent { + public var noContent: Operations.TeamsDeleteLegacy.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -9348,36 +8024,47 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. - public init() {} - } - /// Forbidden if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/403`. + /// Resource not found /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsRemoveMembershipForUserInOrg.Output.Forbidden) - /// Forbidden if team synchronization is set up + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/responses/404`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/memberships/{username}/delete(teams/remove-membership-for-user-in-org)/responses/403`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.forbidden`. + /// Validation failed, or the endpoint has been spammed. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.TeamsRemoveMembershipForUserInOrg.Output.Forbidden { + /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/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 .forbidden(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "unprocessableContent", response: self ) } @@ -9388,51 +8075,68 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - } - /// List team projects - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. - public enum TeamsListProjectsInOrg { - public static let id: Swift.String = "teams/list-projects-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug - ) { - self.org = org - self.teamSlug = teamSlug + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List pending team invitations (Legacy) + /// + /// > [!WARNING] + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// + /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + /// + /// - Remark: HTTP `GET /teams/{team_id}/invitations`. + /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)`. + public enum TeamsListPendingInvitationsLegacy { + public static let id: Swift.String = "teams/list-pending-invitations-legacy" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the team. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/path/team_id`. + public var teamId: Components.Parameters.TeamId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - teamId: The unique identifier of the team. + public init(teamId: Components.Parameters.TeamId) { + self.teamId = teamId } } - public var path: Operations.TeamsListProjectsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/query`. + public var path: Operations.TeamsListPendingInvitationsLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/query/per_page`. + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/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}/teams/{team_slug}/projects/GET/query/page`. + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -9447,19 +8151,19 @@ public enum Operations { self.page = page } } - public var query: Operations.TeamsListProjectsInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/header`. + public var query: Operations.TeamsListPendingInvitationsLegacy.Input.Query + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/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.TeamsListProjectsInOrg.Input.Headers + public var headers: Operations.TeamsListPendingInvitationsLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -9467,9 +8171,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.TeamsListProjectsInOrg.Input.Path, - query: Operations.TeamsListProjectsInOrg.Input.Query = .init(), - headers: Operations.TeamsListProjectsInOrg.Input.Headers = .init() + path: Operations.TeamsListPendingInvitationsLegacy.Input.Path, + query: Operations.TeamsListPendingInvitationsLegacy.Input.Query = .init(), + headers: Operations.TeamsListPendingInvitationsLegacy.Input.Headers = .init() ) { self.path = path self.query = query @@ -9478,9 +8182,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -9491,16 +8195,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.TeamsListProjectsInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/responses/200/content`. + public var headers: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Headers + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamProject]) + /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) /// 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.TeamProject] { + public var json: [Components.Schemas.OrganizationInvitation] { get throws { switch self { case let .json(body): @@ -9510,15 +8214,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsListProjectsInOrg.Output.Ok.Body + public var body: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.TeamsListProjectsInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListProjectsInOrg.Output.Ok.Body + headers: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Headers = .init(), + body: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Body ) { self.headers = headers self.body = body @@ -9526,15 +8230,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListProjectsInOrg.Output.Ok) + case ok(Operations.TeamsListPendingInvitationsLegacy.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.TeamsListProjectsInOrg.Output.Ok { + public var ok: Operations.TeamsListPendingInvitationsLegacy.Output.Ok { get throws { switch self { case let .ok(response): @@ -9578,4608 +8282,123 @@ public enum Operations { } } } - /// Check team permissions for a project + /// List team members (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// + /// Team members will include the members of child teams. /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. - public enum TeamsCheckPermissionsForProjectInOrg { - public static let id: Swift.String = "teams/check-permissions-for-project-in-org" + /// - Remark: HTTP `GET /teams/{team_id}/members`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. + public enum TeamsListMembersLegacy { + public static let id: Swift.String = "teams/list-members-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The unique identifier of the project. + /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/path/team_id`. + public var teamId: Components.Parameters.TeamId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - projectId: The unique identifier of the project. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - projectId: Components.Parameters.ProjectId - ) { - self.org = org - self.teamSlug = teamSlug - self.projectId = projectId - } - } - public var path: Operations.TeamsCheckPermissionsForProjectInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsCheckPermissionsForProjectInOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsCheckPermissionsForProjectInOrg.Input.Path, - headers: Operations.TeamsCheckPermissionsForProjectInOrg.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}/teams/{team_slug}/projects/{project_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamProject) - /// 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.TeamProject { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsCheckPermissionsForProjectInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsCheckPermissionsForProjectInOrg.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsCheckPermissionsForProjectInOrg.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.TeamsCheckPermissionsForProjectInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if project is not managed by this team - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsCheckPermissionsForProjectInOrg.Output.NotFound) - /// Not Found if project is not managed by this team - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsCheckPermissionsForProjectInOrg.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) + /// - teamId: The unique identifier of the team. + public init(teamId: Components.Parameters.TeamId) { + self.teamId = teamId } } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" + public var path: Operations.TeamsListMembersLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" + case all = "all" } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Add or update team project permissions - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. - public enum TeamsAddOrUpdateProjectPermissionsInOrg { - public static let id: Swift.String = "teams/add-or-update-project-permissions-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. + /// Filters members returned by their role in the team. /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - projectId: The unique identifier of the project. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - projectId: Components.Parameters.ProjectId - ) { - self.org = org - self.teamSlug = teamSlug - self.projectId = projectId - } - } - public var path: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_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.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/requestBody/json/permission`. - @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - } - /// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/requestBody/json/permission`. - public var permission: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body.JsonPayload.PermissionPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - permission: The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - public init(permission: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body.JsonPayload.PermissionPayload? = nil) { - self.permission = permission - } - public enum CodingKeys: String, CodingKey { - case permission - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/requestBody/content/application\/json`. - case json(Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body.JsonPayload) - } - public var body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Path, - headers: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.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}/teams/{team_slug}/projects/{project_id}/PUT/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/PUT/responses/403/content/application\/json`. - case json(Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden if the project is not owned by the organization - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsAddOrUpdateProjectPermissionsInOrg.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.TeamsAddOrUpdateProjectPermissionsInOrg.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Remove a project from a team - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. - public enum TeamsRemoveProjectInOrg { - public static let id: Swift.String = "teams/remove-project-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/projects/{project_id}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - projectId: The unique identifier of the project. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - projectId: Components.Parameters.ProjectId - ) { - self.org = org - self.teamSlug = teamSlug - self.projectId = projectId - } - } - public var path: Operations.TeamsRemoveProjectInOrg.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsRemoveProjectInOrg.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}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveProjectInOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsRemoveProjectInOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List team repositories - /// - /// Lists a team's repositories visible to the authenticated user. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)`. - public enum TeamsListReposInOrg { - public static let id: Swift.String = "teams/list-repos-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug - ) { - self.org = org - self.teamSlug = teamSlug - } - } - public var path: Operations.TeamsListReposInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/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}/teams/{team_slug}/repos/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}/teams/{team_slug}/repos/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.TeamsListReposInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListReposInOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListReposInOrg.Input.Path, - query: Operations.TeamsListReposInOrg.Input.Query = .init(), - headers: Operations.TeamsListReposInOrg.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}/teams/{team_slug}/repos/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.TeamsListReposInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/GET/responses/200/content/application\/json`. - case json([Components.Schemas.MinimalRepository]) - /// 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.MinimalRepository] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListReposInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListReposInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListReposInOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/get(teams/list-repos-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListReposInOrg.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.TeamsListReposInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Check team permissions for a repository - /// - /// Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. - /// - /// You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header. - /// - /// If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. - /// - /// If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)`. - public enum TeamsCheckPermissionsForRepoInOrg { - public static let id: Swift.String = "teams/check-permissions-for-repo-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.org = org - self.teamSlug = teamSlug - self.owner = owner - self.repo = repo - } - } - public var path: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsCheckPermissionsForRepoInOrg.Input.Path, - headers: Operations.TeamsCheckPermissionsForRepoInOrg.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}/teams/{team_slug}/repos/{owner}/{repo}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamRepository) - /// 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.TeamRepository { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsCheckPermissionsForRepoInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsCheckPermissionsForRepoInOrg.Output.Ok.Body) { - self.body = body - } - } - /// Alternative response with repository permissions - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsCheckPermissionsForRepoInOrg.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.TeamsCheckPermissionsForRepoInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsCheckPermissionsForRepoInOrg.Output.NoContent) - /// Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsCheckPermissionsForRepoInOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if team does not have permission for the repository - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsCheckPermissionsForRepoInOrg.Output.NotFound) - /// Not Found if team does not have permission for the repository - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/get(teams/check-permissions-for-repo-in-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsCheckPermissionsForRepoInOrg.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Add or update team repository permissions - /// - /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. - /// - /// For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". - /// - /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)`. - public enum TeamsAddOrUpdateRepoPermissionsInOrg { - public static let id: Swift.String = "teams/add-or-update-repo-permissions-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.org = org - self.teamSlug = teamSlug - self.owner = owner - self.repo = repo - } - } - public var path: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/json/permission`. - public var permission: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - permission: The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. - public init(permission: Swift.String? = nil) { - self.permission = permission - } - public enum CodingKeys: String, CodingKey { - case permission - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/PUT/requestBody/content/application\/json`. - case json(Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body.JsonPayload) - } - public var body: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - body: - public init( - path: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Path, - body: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Input.Body? = nil - ) { - self.path = path - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/put(teams/add-or-update-repo-permissions-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsAddOrUpdateRepoPermissionsInOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Remove a repository from a team - /// - /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)`. - public enum TeamsRemoveRepoInOrg { - public static let id: Swift.String = "teams/remove-repo-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.org = org - self.teamSlug = teamSlug - self.owner = owner - self.repo = repo - } - } - public var path: Operations.TeamsRemoveRepoInOrg.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsRemoveRepoInOrg.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}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveRepoInOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}/delete(teams/remove-repo-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsRemoveRepoInOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List child teams - /// - /// Lists the child teams of the team specified by `{team_slug}`. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. - /// - /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)`. - public enum TeamsListChildInOrg { - public static let id: Swift.String = "teams/list-child-in-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug - ) { - self.org = org - self.teamSlug = teamSlug - } - } - public var path: Operations.TeamsListChildInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/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}/teams/{team_slug}/teams/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.TeamsListChildInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListChildInOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListChildInOrg.Input.Path, - query: Operations.TeamsListChildInOrg.Input.Query = .init(), - headers: Operations.TeamsListChildInOrg.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}/teams/{team_slug}/teams/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.TeamsListChildInOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/teams/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Team]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Team] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListChildInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListChildInOrg.Output.Ok.Headers = .init(), - body: Operations.TeamsListChildInOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// if child teams exist - /// - /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/teams/get(teams/list-child-in-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListChildInOrg.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.TeamsListChildInOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. - public enum TeamsGetLegacy { - public static let id: Swift.String = "teams/get-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsGetLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsGetLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsGetLegacy.Input.Path, - headers: Operations.TeamsGetLegacy.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamFull) - /// 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.TeamFull { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsGetLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsGetLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetLegacy.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.TeamsGetLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. - /// - /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. - /// - /// > [!NOTE] - /// > With nested teams, the `privacy` for parent teams cannot be `secret`. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)`. - public enum TeamsUpdateLegacy { - public static let id: Swift.String = "teams/update-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsUpdateLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsUpdateLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/name`. - public var name: Swift.String - /// The description of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/description`. - public var description: Swift.String? - /// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: - /// **For a non-nested team:** - /// * `secret` - only visible to organization owners and members of this team. - /// * `closed` - visible to all members of this organization. - /// **For a parent or child team:** - /// * `closed` - visible to all members of this organization. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/privacy`. - @frozen public enum PrivacyPayload: String, Codable, Hashable, Sendable, CaseIterable { - case secret = "secret" - case closed = "closed" - } - /// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: - /// **For a non-nested team:** - /// * `secret` - only visible to organization owners and members of this team. - /// * `closed` - visible to all members of this organization. - /// **For a parent or child team:** - /// * `closed` - visible to all members of this organization. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/privacy`. - public var privacy: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PrivacyPayload? - /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: - /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. - /// * `notifications_disabled` - no one receives notifications. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/notification_setting`. - @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { - case notificationsEnabled = "notifications_enabled" - case notificationsDisabled = "notifications_disabled" - } - /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: - /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. - /// * `notifications_disabled` - no one receives notifications. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/notification_setting`. - public var notificationSetting: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.NotificationSettingPayload? - /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. - @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pull = "pull" - case push = "push" - case admin = "admin" - } - /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. - public var permission: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PermissionPayload? - /// The ID of a team to set as the parent team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/parent_team_id`. - public var parentTeamId: Swift.Int? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the team. - /// - description: The description of the team. - /// - privacy: The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: - /// - notificationSetting: The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: - /// - permission: **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. - /// - parentTeamId: The ID of a team to set as the parent team. - public init( - name: Swift.String, - description: Swift.String? = nil, - privacy: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PrivacyPayload? = nil, - notificationSetting: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.NotificationSettingPayload? = nil, - permission: Operations.TeamsUpdateLegacy.Input.Body.JsonPayload.PermissionPayload? = nil, - parentTeamId: Swift.Int? = nil - ) { - self.name = name - self.description = description - self.privacy = privacy - self.notificationSetting = notificationSetting - self.permission = permission - self.parentTeamId = parentTeamId - } - public enum CodingKeys: String, CodingKey { - case name - case description - case privacy - case notificationSetting = "notification_setting" - case permission - case parentTeamId = "parent_team_id" - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.TeamsUpdateLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsUpdateLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsUpdateLegacy.Input.Path, - headers: Operations.TeamsUpdateLegacy.Input.Headers = .init(), - body: Operations.TeamsUpdateLegacy.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/teams/{team_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.TeamFull) - /// 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.TeamFull { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsUpdateLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response when the updated information already exists - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsUpdateLegacy.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.TeamsUpdateLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/responses/201/content/application\/json`. - case json(Components.Schemas.TeamFull) - /// 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.TeamFull { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsUpdateLegacy.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateLegacy.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.TeamsUpdateLegacy.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.TeamsUpdateLegacy.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/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//teams/{team_id}/patch(teams/update-legacy)/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 - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/patch(teams/update-legacy)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a team (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. - /// - /// To delete a team, the authenticated user must be an organization owner or team maintainer. - /// - /// If you are an organization owner, deleting a parent team will delete all of its child teams as well. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)`. - public enum TeamsDeleteLegacy { - public static let id: Swift.String = "teams/delete-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsDeleteLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsDeleteLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsDeleteLegacy.Input.Path, - headers: Operations.TeamsDeleteLegacy.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsDeleteLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/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.TeamsDeleteLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/delete(teams/delete-legacy)/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//teams/{team_id}/delete(teams/delete-legacy)/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 - ] - } - } - } - /// List discussions (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. - /// - /// List all discussions on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/get(teams/list-discussions-legacy)`. - public enum TeamsListDiscussionsLegacy { - public static let id: Swift.String = "teams/list-discussions-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsListDiscussionsLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// 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/teams/{team_id}/discussions/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/teams/{team_id}/discussions/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - direction: The direction to sort the results by. - /// - 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( - direction: Components.Parameters.Direction? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.direction = direction - self.perPage = perPage - self.page = page - } - } - public var query: Operations.TeamsListDiscussionsLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListDiscussionsLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListDiscussionsLegacy.Input.Path, - query: Operations.TeamsListDiscussionsLegacy.Input.Query = .init(), - headers: Operations.TeamsListDiscussionsLegacy.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/teams/{team_id}/discussions/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/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.TeamsListDiscussionsLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamDiscussion]) - /// 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.TeamDiscussion] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListDiscussionsLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListDiscussionsLegacy.Output.Ok.Headers = .init(), - body: Operations.TeamsListDiscussionsLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/get(teams/list-discussions-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListDiscussionsLegacy.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.TeamsListDiscussionsLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. - /// - /// Creates a new discussion post on a team's page. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/post(teams/create-discussion-legacy)`. - public enum TeamsCreateDiscussionLegacy { - public static let id: Swift.String = "teams/create-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsCreateDiscussionLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsCreateDiscussionLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion post's title. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody/json/title`. - public var title: Swift.String - /// The discussion post's body text. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody/json/body`. - public var body: Swift.String - /// Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody/json/private`. - public var _private: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - title: The discussion post's title. - /// - body: The discussion post's body text. - /// - _private: Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - public init( - title: Swift.String, - body: Swift.String, - _private: Swift.Bool? = nil - ) { - self.title = title - self.body = body - self._private = _private - } - public enum CodingKeys: String, CodingKey { - case title - case body - case _private = "private" - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/requestBody/content/application\/json`. - case json(Operations.TeamsCreateDiscussionLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsCreateDiscussionLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsCreateDiscussionLegacy.Input.Path, - headers: Operations.TeamsCreateDiscussionLegacy.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionLegacy.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/teams/{team_id}/discussions/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/POST/responses/201/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) - /// 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.TeamDiscussion { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsCreateDiscussionLegacy.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsCreateDiscussionLegacy.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/post(teams/create-discussion-legacy)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.TeamsCreateDiscussionLegacy.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.TeamsCreateDiscussionLegacy.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. - /// - /// Get a specific discussion on a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/get(teams/get-discussion-legacy)`. - public enum TeamsGetDiscussionLegacy { - public static let id: Swift.String = "teams/get-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.TeamsGetDiscussionLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsGetDiscussionLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsGetDiscussionLegacy.Input.Path, - headers: Operations.TeamsGetDiscussionLegacy.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) - /// 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.TeamDiscussion { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsGetDiscussionLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsGetDiscussionLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/get(teams/get-discussion-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetDiscussionLegacy.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.TeamsGetDiscussionLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. - /// - /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/patch(teams/update-discussion-legacy)`. - public enum TeamsUpdateDiscussionLegacy { - public static let id: Swift.String = "teams/update-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.TeamsUpdateDiscussionLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsUpdateDiscussionLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion post's title. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/requestBody/json/title`. - public var title: Swift.String? - /// The discussion post's body text. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - title: The discussion post's title. - /// - body: The discussion post's body text. - public init( - title: Swift.String? = nil, - body: Swift.String? = nil - ) { - self.title = title - self.body = body - } - public enum CodingKeys: String, CodingKey { - case title - case body - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.TeamsUpdateDiscussionLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsUpdateDiscussionLegacy.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsUpdateDiscussionLegacy.Input.Path, - headers: Operations.TeamsUpdateDiscussionLegacy.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionLegacy.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussion) - /// 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.TeamDiscussion { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsUpdateDiscussionLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateDiscussionLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/patch(teams/update-discussion-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsUpdateDiscussionLegacy.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.TeamsUpdateDiscussionLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a discussion (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. - /// - /// Delete a discussion from a team's page. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)`. - public enum TeamsDeleteDiscussionLegacy { - public static let id: Swift.String = "teams/delete-discussion-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/DELETE/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.TeamsDeleteDiscussionLegacy.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsDeleteDiscussionLegacy.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//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsDeleteDiscussionLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/delete(teams/delete-discussion-legacy)/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.TeamsDeleteDiscussionLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List discussion comments (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. - /// - /// List all comments on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-legacy)`. - public enum TeamsListDiscussionCommentsLegacy { - public static let id: Swift.String = "teams/list-discussion-comments-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.TeamsListDiscussionCommentsLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// 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/teams/{team_id}/discussions/{discussion_number}/comments/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/teams/{team_id}/discussions/{discussion_number}/comments/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - direction: The direction to sort the results by. - /// - 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( - direction: Components.Parameters.Direction? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.direction = direction - self.perPage = perPage - self.page = page - } - } - public var query: Operations.TeamsListDiscussionCommentsLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListDiscussionCommentsLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListDiscussionCommentsLegacy.Input.Path, - query: Operations.TeamsListDiscussionCommentsLegacy.Input.Query = .init(), - headers: Operations.TeamsListDiscussionCommentsLegacy.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/teams/{team_id}/discussions/{discussion_number}/comments/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/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.TeamsListDiscussionCommentsLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamDiscussionComment]) - /// 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.TeamDiscussionComment] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListDiscussionCommentsLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListDiscussionCommentsLegacy.Output.Ok.Headers = .init(), - body: Operations.TeamsListDiscussionCommentsLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/get(teams/list-discussion-comments-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListDiscussionCommentsLegacy.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.TeamsListDiscussionCommentsLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. - /// - /// Creates a new comment on a team discussion. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /teams/{team_id}/discussions/{discussion_number}/comments`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-legacy)`. - public enum TeamsCreateDiscussionCommentLegacy { - public static let id: Swift.String = "teams/create-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - } - } - public var path: Operations.TeamsCreateDiscussionCommentLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsCreateDiscussionCommentLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion comment's body text. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The discussion comment's body text. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/requestBody/content/application\/json`. - case json(Operations.TeamsCreateDiscussionCommentLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsCreateDiscussionCommentLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsCreateDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsCreateDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.TeamsCreateDiscussionCommentLegacy.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/teams/{team_id}/discussions/{discussion_number}/comments/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/POST/responses/201/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) - /// 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.TeamDiscussionComment { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsCreateDiscussionCommentLegacy.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsCreateDiscussionCommentLegacy.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/post(teams/create-discussion-comment-legacy)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.TeamsCreateDiscussionCommentLegacy.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.TeamsCreateDiscussionCommentLegacy.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. - /// - /// Get a specific comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-legacy)`. - public enum TeamsGetDiscussionCommentLegacy { - public static let id: Swift.String = "teams/get-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.TeamsGetDiscussionCommentLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsGetDiscussionCommentLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsGetDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsGetDiscussionCommentLegacy.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) - /// 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.TeamDiscussionComment { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsGetDiscussionCommentLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsGetDiscussionCommentLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/get(teams/get-discussion-comment-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetDiscussionCommentLegacy.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.TeamsGetDiscussionCommentLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. - /// - /// Edits the body text of a discussion comment. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-legacy)`. - public enum TeamsUpdateDiscussionCommentLegacy { - public static let id: Swift.String = "teams/update-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The discussion comment's body text. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The discussion comment's body text. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.TeamsUpdateDiscussionCommentLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Path, - headers: Operations.TeamsUpdateDiscussionCommentLegacy.Input.Headers = .init(), - body: Operations.TeamsUpdateDiscussionCommentLegacy.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/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.TeamDiscussionComment) - /// 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.TeamDiscussionComment { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsUpdateDiscussionCommentLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsUpdateDiscussionCommentLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/patch(teams/update-discussion-comment-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsUpdateDiscussionCommentLegacy.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.TeamsUpdateDiscussionCommentLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a discussion comment (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. - /// - /// Deletes a comment on a team discussion. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)`. - public enum TeamsDeleteDiscussionCommentLegacy { - public static let id: Swift.String = "teams/delete-discussion-comment-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The number that identifies the discussion. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/discussion_number`. - public var discussionNumber: Components.Parameters.DiscussionNumber - /// The number that identifies the comment. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/DELETE/path/comment_number`. - public var commentNumber: Components.Parameters.CommentNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - discussionNumber: The number that identifies the discussion. - /// - commentNumber: The number that identifies the comment. - public init( - teamId: Components.Parameters.TeamId, - discussionNumber: Components.Parameters.DiscussionNumber, - commentNumber: Components.Parameters.CommentNumber - ) { - self.teamId = teamId - self.discussionNumber = discussionNumber - self.commentNumber = commentNumber - } - } - public var path: Operations.TeamsDeleteDiscussionCommentLegacy.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsDeleteDiscussionCommentLegacy.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//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsDeleteDiscussionCommentLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/delete(teams/delete-discussion-comment-legacy)/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.TeamsDeleteDiscussionCommentLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List pending team invitations (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. - /// - /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. - /// - /// - Remark: HTTP `GET /teams/{team_id}/invitations`. - /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)`. - public enum TeamsListPendingInvitationsLegacy { - public static let id: Swift.String = "teams/list-pending-invitations-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsListPendingInvitationsLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/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/teams/{team_id}/invitations/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.TeamsListPendingInvitationsLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListPendingInvitationsLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListPendingInvitationsLegacy.Input.Path, - query: Operations.TeamsListPendingInvitationsLegacy.Input.Query = .init(), - headers: Operations.TeamsListPendingInvitationsLegacy.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/teams/{team_id}/invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) - /// 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.OrganizationInvitation] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Headers = .init(), - body: Operations.TeamsListPendingInvitationsLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/invitations/get(teams/list-pending-invitations-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListPendingInvitationsLegacy.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.TeamsListPendingInvitationsLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List team members (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. - /// - /// Team members will include the members of child teams. - /// - /// - Remark: HTTP `GET /teams/{team_id}/members`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. - public enum TeamsListMembersLegacy { - public static let id: Swift.String = "teams/list-members-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsListMembersLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case member = "member" - case maintainer = "maintainer" - case all = "all" - } - /// Filters members returned by their role in the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query/role`. - public var role: Operations.TeamsListMembersLegacy.Input.Query.RolePayload? - /// 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/teams/{team_id}/members/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/teams/{team_id}/members/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - role: Filters members returned by their role in the team. - /// - 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( - role: Operations.TeamsListMembersLegacy.Input.Query.RolePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.role = role - self.perPage = perPage - self.page = page - } - } - public var query: Operations.TeamsListMembersLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsListMembersLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListMembersLegacy.Input.Path, - query: Operations.TeamsListMembersLegacy.Input.Query = .init(), - headers: Operations.TeamsListMembersLegacy.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/teams/{team_id}/members/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/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.TeamsListMembersLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListMembersLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListMembersLegacy.Output.Ok.Headers = .init(), - body: Operations.TeamsListMembersLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListMembersLegacy.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.TeamsListMembersLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get team member (Legacy) - /// - /// The "Get team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. - /// - /// To list members in a team, the team must be visible to the authenticated user. - /// - /// - Remark: HTTP `GET /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)`. - public enum TeamsGetMemberLegacy { - public static let id: Swift.String = "teams/get-member-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - username: The handle for the GitHub user account. - public init( - teamId: Components.Parameters.TeamId, - username: Components.Parameters.Username - ) { - self.teamId = teamId - self.username = username - } - } - public var path: Operations.TeamsGetMemberLegacy.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsGetMemberLegacy.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// if user is a member - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsGetMemberLegacy.Output.NoContent) - /// if user is a member - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/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.TeamsGetMemberLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// if user is not a member - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsGetMemberLegacy.Output.NotFound) - /// if user is not a member - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsGetMemberLegacy.Output.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) - } - } - /// Add team member (Legacy) - /// - /// The "Add team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - /// - /// - Remark: HTTP `PUT /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)`. - public enum TeamsAddMemberLegacy { - public static let id: Swift.String = "teams/add-member-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - username: The handle for the GitHub user account. - public init( - teamId: Components.Parameters.TeamId, - username: Components.Parameters.Username - ) { - self.teamId = teamId - self.username = username - } - } - public var path: Operations.TeamsAddMemberLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsAddMemberLegacy.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.TeamsAddMemberLegacy.Input.Path, - headers: Operations.TeamsAddMemberLegacy.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsAddMemberLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/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.TeamsAddMemberLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsAddMemberLegacy.Output.NotFound) - /// Not Found if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsAddMemberLegacy.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.TeamsAddMemberLegacy.Output.UnprocessableContent) - /// Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.TeamsAddMemberLegacy.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Remove team member (Legacy) - /// - /// The "Remove team member" endpoint (described below) is closing down. - /// - /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. - /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - /// - /// - Remark: HTTP `DELETE /teams/{team_id}/members/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)`. - public enum TeamsRemoveMemberLegacy { - public static let id: Swift.String = "teams/remove-member-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - username: The handle for the GitHub user account. - public init( - teamId: Components.Parameters.TeamId, - username: Components.Parameters.Username - ) { - self.teamId = teamId - self.username = username - } - } - public var path: Operations.TeamsRemoveMemberLegacy.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.TeamsRemoveMemberLegacy.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//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveMemberLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/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.TeamsRemoveMemberLegacy.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if team synchronization is setup - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsRemoveMemberLegacy.Output.NotFound) - /// Not Found if team synchronization is setup - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.TeamsRemoveMemberLegacy.Output.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) - } - } - /// Get team membership for a user (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. - /// - /// Team members will include the members of child teams. - /// - /// To get a user's membership with a team, the team must be visible to the authenticated user. - /// - /// **Note:** - /// The response contains the `state` of the membership and the member's `role`. - /// - /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). - /// - /// - Remark: HTTP `GET /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)`. - public enum TeamsGetMembershipForUserLegacy { - public static let id: Swift.String = "teams/get-membership-for-user-legacy" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/path/team_id`. - public var teamId: Components.Parameters.TeamId - /// The handle for the GitHub user account. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/query/role`. + public var role: Operations.TeamsListMembersLegacy.Input.Query.RolePayload? + /// 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/teams/{team_id}/memberships/{username}/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/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/teams/{team_id}/members/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. /// /// - Parameters: - /// - teamId: The unique identifier of the team. - /// - username: The handle for the GitHub user account. + /// - role: Filters members returned by their role in the team. + /// - 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( - teamId: Components.Parameters.TeamId, - username: Components.Parameters.Username + role: Operations.TeamsListMembersLegacy.Input.Query.RolePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.teamId = teamId - self.username = username + self.role = role + self.perPage = perPage + self.page = page } } - public var path: Operations.TeamsGetMembershipForUserLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/header`. + public var query: Operations.TeamsListMembersLegacy.Input.Query + /// - Remark: Generated from `#/paths/teams/{team_id}/members/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.TeamsGetMembershipForUserLegacy.Input.Headers + public var headers: Operations.TeamsListMembersLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.TeamsGetMembershipForUserLegacy.Input.Path, - headers: Operations.TeamsGetMembershipForUserLegacy.Input.Headers = .init() + path: Operations.TeamsListMembersLegacy.Input.Path, + query: Operations.TeamsListMembersLegacy.Input.Query = .init(), + headers: Operations.TeamsListMembersLegacy.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/teams/{team_id}/memberships/{username}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/members/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.TeamsListMembersLegacy.Output.Ok.Headers + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamMembership) + /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.TeamMembership { + public var json: [Components.Schemas.SimpleUser] { get throws { switch self { case let .json(body): @@ -14189,26 +8408,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsGetMembershipForUserLegacy.Output.Ok.Body + public var body: Operations.TeamsListMembersLegacy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.TeamsGetMembershipForUserLegacy.Output.Ok.Body) { + public init( + headers: Operations.TeamsListMembersLegacy.Output.Ok.Headers = .init(), + body: Operations.TeamsListMembersLegacy.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsGetMembershipForUserLegacy.Output.Ok) + case ok(Operations.TeamsListMembersLegacy.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.TeamsGetMembershipForUserLegacy.Output.Ok { + public var ok: Operations.TeamsListMembersLegacy.Output.Ok { get throws { switch self { case let .ok(response): @@ -14223,7 +8447,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)/responses/404`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -14275,36 +8499,28 @@ public enum Operations { } } } - /// Add or update team membership for a user (Legacy) - /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. - /// - /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - /// - /// If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. + /// Get team member (Legacy) /// - /// > [!NOTE] - /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// The "Get team member" endpoint (described below) is closing down. /// - /// If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. + /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// - /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + /// To list members in a team, the team must be visible to the authenticated user. /// - /// - Remark: HTTP `PUT /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)`. - public enum TeamsAddOrUpdateMembershipForUserLegacy { - public static let id: Swift.String = "teams/add-or-update-membership-for-user-legacy" + /// - Remark: HTTP `GET /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)`. + public enum TeamsGetMemberLegacy { + public static let id: Swift.String = "teams/get-member-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path/team_id`. public var teamId: Components.Parameters.TeamId /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path/username`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -14319,198 +8535,74 @@ public enum Operations { self.username = username } } - public var path: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The role that this user should have in the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case member = "member" - case maintainer = "maintainer" - } - /// The role that this user should have in the team. - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json/role`. - public var role: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload.RolePayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - role: The role that this user should have in the team. - public init(role: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload.RolePayload? = nil) { - self.role = role - } - public enum CodingKeys: String, CodingKey { - case role - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload) - } - public var body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body? + public var path: Operations.TeamsGetMemberLegacy.Input.Path /// Creates a new `Input`. /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Path, - headers: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.TeamMembership) - /// 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.TeamMembership { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsAddOrUpdateMembershipForUserLegacy.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.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. - public init() {} - } - /// Forbidden if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Forbidden) - /// Forbidden if team synchronization is set up - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) - } - /// 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.TeamsAddOrUpdateMembershipForUserLegacy.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } + /// - Parameters: + /// - path: + public init(path: Operations.TeamsGetMemberLegacy.Input.Path) { + self.path = path } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. public init() {} } - /// Unprocessable Entity if you attempt to add an organization to a team + /// if user is a member /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/422`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/204`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.UnprocessableContent) - /// Unprocessable Entity if you attempt to add an organization to a team + /// HTTP response code: `204 noContent`. + case noContent(Operations.TeamsGetMemberLegacy.Output.NoContent) + /// if user is a member /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/422`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/204`. /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.UnprocessableContent { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.TeamsGetMemberLegacy.Output.NoContent { get throws { switch self { - case let .unprocessableContent(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "noContent", response: self ) } } } - /// Resource not found + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// if user is not a member /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/404`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) + case notFound(Operations.TeamsGetMemberLegacy.Output.NotFound) + /// if user is not a member + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/get(teams/get-member-legacy)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + public var notFound: Operations.TeamsGetMemberLegacy.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -14528,58 +8620,36 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Remove team membership for a user (Legacy) + /// Add team member (Legacy) /// - /// > [!WARNING] - /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// The "Add team member" endpoint (described below) is closing down. + /// + /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// - /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. /// /// > [!NOTE] /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `DELETE /teams/{team_id}/memberships/{username}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)`. - public enum TeamsRemoveMembershipForUserLegacy { - public static let id: Swift.String = "teams/remove-membership-for-user-legacy" + /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// + /// - Remark: HTTP `PUT /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)`. + public enum TeamsAddMemberLegacy { + public static let id: Swift.String = "teams/add-member-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path/team_id`. public var teamId: Components.Parameters.TeamId /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path/username`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -14594,13 +8664,30 @@ public enum Operations { self.username = username } } - public var path: Operations.TeamsRemoveMembershipForUserLegacy.Input.Path + public var path: Operations.TeamsAddMemberLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.TeamsAddMemberLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.TeamsRemoveMembershipForUserLegacy.Input.Path) { + /// - headers: + public init( + path: Operations.TeamsAddMemberLegacy.Input.Path, + headers: Operations.TeamsAddMemberLegacy.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -14610,13 +8697,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveMembershipForUserLegacy.Output.NoContent) + case noContent(Operations.TeamsAddMemberLegacy.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -14626,7 +8713,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsRemoveMembershipForUserLegacy.Output.NoContent { + public var noContent: Operations.TeamsAddMemberLegacy.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -14639,29 +8726,87 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. public init() {} } - /// if team synchronization is set up + /// Not Found if team synchronization is set up /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/403`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsRemoveMembershipForUserLegacy.Output.Forbidden) - /// if team synchronization is set up + /// HTTP response code: `404 notFound`. + case notFound(Operations.TeamsAddMemberLegacy.Output.NotFound) + /// Not Found if team synchronization is set up /// - /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/403`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.TeamsAddMemberLegacy.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.TeamsAddMemberLegacy.Output.UnprocessableContent) + /// Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.TeamsAddMemberLegacy.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/put(teams/add-member-legacy)/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: Operations.TeamsRemoveMembershipForUserLegacy.Output.Forbidden { + public var forbidden: Components.Responses.Forbidden { get throws { switch self { case let .forbidden(response): @@ -14679,167 +8824,141 @@ 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 team projects (Legacy) + /// Remove team member (Legacy) /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// The "Remove team member" endpoint (described below) is closing down. + /// + /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. + /// + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// + /// To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. + /// + /// > [!NOTE] + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `GET /teams/{team_id}/projects`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. - public enum TeamsListProjectsLegacy { - public static let id: Swift.String = "teams/list-projects-legacy" + /// - Remark: HTTP `DELETE /teams/{team_id}/members/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)`. + public enum TeamsRemoveMemberLegacy { + public static let id: Swift.String = "teams/remove-member-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path/team_id`. public var teamId: Components.Parameters.TeamId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/teams/{team_id}/members/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - teamId: The unique identifier of the team. - public init(teamId: Components.Parameters.TeamId) { - self.teamId = teamId - } - } - public var path: Operations.TeamsListProjectsLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/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/teams/{team_id}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/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)." + /// - username: The handle for the GitHub user account. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + teamId: Components.Parameters.TeamId, + username: Components.Parameters.Username ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.TeamsListProjectsLegacy.Input.Query - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.teamId = teamId + self.username = username } } - public var headers: Operations.TeamsListProjectsLegacy.Input.Headers + public var path: Operations.TeamsRemoveMemberLegacy.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: - /// - headers: - public init( - path: Operations.TeamsListProjectsLegacy.Input.Path, - query: Operations.TeamsListProjectsLegacy.Input.Query = .init(), - headers: Operations.TeamsListProjectsLegacy.Input.Headers = .init() - ) { + public init(path: Operations.TeamsRemoveMemberLegacy.Input.Path) { self.path = path - self.query = query - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.TeamsListProjectsLegacy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamProject]) - /// 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.TeamProject] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.TeamsListProjectsLegacy.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.TeamsListProjectsLegacy.Output.Ok.Headers = .init(), - body: Operations.TeamsListProjectsLegacy.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.TeamsListProjectsLegacy.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.TeamsRemoveMemberLegacy.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.TeamsListProjectsLegacy.Output.Ok { + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/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.TeamsRemoveMemberLegacy.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 ) } } } - /// Resource not found + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if team synchronization is setup /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)/responses/404`. + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) + case notFound(Operations.TeamsRemoveMemberLegacy.Output.NotFound) + /// Not Found if team synchronization is setup + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/members/{username}/delete(teams/remove-member-legacy)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + public var notFound: Operations.TeamsRemoveMemberLegacy.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -14857,87 +8976,70 @@ 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 - ] - } - } } - /// Check team permissions for a project (Legacy) + /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// + /// Team members will include the members of child teams. + /// + /// To get a user's membership with a team, the team must be visible to the authenticated user. + /// + /// **Note:** + /// The response contains the `state` of the membership and the member's `role`. /// - /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. - public enum TeamsCheckPermissionsForProjectLegacy { - public static let id: Swift.String = "teams/check-permissions-for-project-legacy" + /// The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). + /// + /// - Remark: HTTP `GET /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)`. + public enum TeamsGetMembershipForUserLegacy { + public static let id: Swift.String = "teams/get-membership-for-user-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/path/team_id`. public var teamId: Components.Parameters.TeamId - /// The unique identifier of the project. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - teamId: The unique identifier of the team. - /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. public init( teamId: Components.Parameters.TeamId, - projectId: Components.Parameters.ProjectId + username: Components.Parameters.Username ) { self.teamId = teamId - self.projectId = projectId + self.username = username } } - public var path: Operations.TeamsCheckPermissionsForProjectLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/header`. + public var path: Operations.TeamsGetMembershipForUserLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/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.TeamsCheckPermissionsForProjectLegacy.Input.Headers + public var headers: Operations.TeamsGetMembershipForUserLegacy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.TeamsCheckPermissionsForProjectLegacy.Input.Path, - headers: Operations.TeamsCheckPermissionsForProjectLegacy.Input.Headers = .init() + path: Operations.TeamsGetMembershipForUserLegacy.Input.Path, + headers: Operations.TeamsGetMembershipForUserLegacy.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -14945,15 +9047,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TeamProject) + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.TeamMembership) /// 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.TeamProject { + public var json: Components.Schemas.TeamMembership { get throws { switch self { case let .json(body): @@ -14963,26 +9065,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsCheckPermissionsForProjectLegacy.Output.Ok.Body + public var body: Operations.TeamsGetMembershipForUserLegacy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsCheckPermissionsForProjectLegacy.Output.Ok.Body) { + public init(body: Operations.TeamsGetMembershipForUserLegacy.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)/responses/200`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.TeamsCheckPermissionsForProjectLegacy.Output.Ok) + case ok(Operations.TeamsGetMembershipForUserLegacy.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.TeamsCheckPermissionsForProjectLegacy.Output.Ok { + public var ok: Operations.TeamsGetMembershipForUserLegacy.Output.Ok { get throws { switch self { case let .ok(response): @@ -14995,29 +9097,17 @@ public enum Operations { } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if project is not managed by this team - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.TeamsCheckPermissionsForProjectLegacy.Output.NotFound) - /// Not Found if project is not managed by this team + /// Resource not found /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)/responses/404`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/get(teams/get-membership-for-user-legacy)/responses/404`. /// /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } + 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: Operations.TeamsCheckPermissionsForProjectLegacy.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -15061,84 +9151,93 @@ public enum Operations { } } } - /// Add or update team project permissions (Legacy) + /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// + /// If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. + /// + /// > [!NOTE] + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + /// + /// If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. + /// + /// If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. /// - /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. - public enum TeamsAddOrUpdateProjectPermissionsLegacy { - public static let id: Swift.String = "teams/add-or-update-project-permissions-legacy" + /// - Remark: HTTP `PUT /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)`. + public enum TeamsAddOrUpdateMembershipForUserLegacy { + public static let id: Swift.String = "teams/add-or-update-membership-for-user-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path/team_id`. public var teamId: Components.Parameters.TeamId - /// The unique identifier of the project. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - teamId: The unique identifier of the team. - /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. public init( teamId: Components.Parameters.TeamId, - projectId: Components.Parameters.ProjectId + username: Components.Parameters.Username ) { self.teamId = teamId - self.projectId = projectId + self.username = username } } - public var path: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/header`. + public var path: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Path + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/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.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Headers - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/requestBody`. + public var headers: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Headers + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// The role that this user should have in the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/requestBody/json/permission`. - @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" } - /// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// The role that this user should have in the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/requestBody/json/permission`. - public var permission: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body.JsonPayload.PermissionPayload? + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/json/role`. + public var role: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload.RolePayload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - permission: The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." - public init(permission: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body.JsonPayload.PermissionPayload? = nil) { - self.permission = permission + /// - role: The role that this user should have in the team. + public init(role: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload.RolePayload? = nil) { + self.role = role } public enum CodingKeys: String, CodingKey { - case permission + case role } } - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/requestBody/content/application\/json`. - case json(Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body.JsonPayload) } - public var body: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body? + public var body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -15146,9 +9245,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Path, - headers: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Headers = .init(), - body: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Input.Body? = nil + path: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Path, + headers: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Headers = .init(), + body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Input.Body? = nil ) { self.path = path self.headers = headers @@ -15156,74 +9255,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)/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.TeamsAddOrUpdateProjectPermissionsLegacy.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/teams/{team_id}/projects/{project_id}/PUT/responses/403/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - } - } - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/PUT/responses/403/content/application\/json`. - case json(Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body.JsonPayload) + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.TeamMembership) /// 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.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body.JsonPayload { + public var json: Components.Schemas.TeamMembership { get throws { switch self { case let .json(body): @@ -15233,72 +9274,96 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body - /// Creates a new `Forbidden`. + public var body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden.Body) { + public init(body: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Ok.Body) { self.body = body } } - /// Forbidden if the project is not owned by the organization + /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)/responses/403`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.TeamsAddOrUpdateMembershipForUserLegacy.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: Operations.TeamsAddOrUpdateProjectPermissionsLegacy.Output.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.TeamsAddOrUpdateMembershipForUserLegacy.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 + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Forbidden if team synchronization is set up /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)/responses/404`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/403`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.Forbidden) + /// Forbidden if team synchronization is set up /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// 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.TeamsAddOrUpdateMembershipForUserLegacy.Output.Forbidden { get throws { switch self { - case let .notFound(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "forbidden", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Unprocessable Entity if you attempt to add an organization to a team /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)/responses/422`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.UnprocessableContent) + /// Unprocessable Entity if you attempt to add an organization to a team + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } /// 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 { + public var unprocessableContent: Operations.TeamsAddOrUpdateMembershipForUserLegacy.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -15311,6 +9376,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/put(teams/add-or-update-membership-for-user-legacy)/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. @@ -15342,64 +9430,53 @@ public enum Operations { } } } - /// Remove a project from a team (Legacy) + /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// + /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + /// + /// To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + /// + /// > [!NOTE] + /// > When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." /// - /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. - public enum TeamsRemoveProjectLegacy { - public static let id: Swift.String = "teams/remove-project-legacy" + /// - Remark: HTTP `DELETE /teams/{team_id}/memberships/{username}`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)`. + public enum TeamsRemoveMembershipForUserLegacy { + public static let id: Swift.String = "teams/remove-membership-for-user-legacy" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The unique identifier of the team. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/DELETE/path/team_id`. + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path/team_id`. public var teamId: Components.Parameters.TeamId - /// The unique identifier of the project. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/teams/{team_id}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - teamId: The unique identifier of the team. - /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. public init( teamId: Components.Parameters.TeamId, - projectId: Components.Parameters.ProjectId + username: Components.Parameters.Username ) { self.teamId = teamId - self.projectId = projectId - } - } - public var path: Operations.TeamsRemoveProjectLegacy.Input.Path - /// - Remark: Generated from `#/paths/teams/{team_id}/projects/{project_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.username = username } } - public var headers: Operations.TeamsRemoveProjectLegacy.Input.Headers + public var path: Operations.TeamsRemoveMembershipForUserLegacy.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.TeamsRemoveProjectLegacy.Input.Path, - headers: Operations.TeamsRemoveProjectLegacy.Input.Headers = .init() - ) { + public init(path: Operations.TeamsRemoveMembershipForUserLegacy.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -15409,13 +9486,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.TeamsRemoveProjectLegacy.Output.NoContent) + case noContent(Operations.TeamsRemoveMembershipForUserLegacy.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)/responses/204`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15425,7 +9502,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.TeamsRemoveProjectLegacy.Output.NoContent { + public var noContent: Operations.TeamsRemoveMembershipForUserLegacy.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15438,47 +9515,36 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)/responses/404`. + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// if team synchronization is set up /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/403`. /// - /// - 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. + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.TeamsRemoveMembershipForUserLegacy.Output.Forbidden) + /// if team synchronization is set up /// - /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)/responses/422`. + /// - Remark: Generated from `#/paths//teams/{team_id}/memberships/{username}/delete(teams/remove-membership-for-user-legacy)/responses/403`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.TeamsRemoveMembershipForUserLegacy.Output.Forbidden { get throws { switch self { - case let .unprocessableContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "forbidden", response: self ) } @@ -15489,31 +9555,6 @@ 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 team repositories (Legacy) /// From 81e439d945d594220f8a89b520618c944d3b81c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:15:23 +0000 Subject: [PATCH 24/33] Commit via running: make Sources/users --- Sources/users/Types.swift | 60 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 4f069d3dc8..cdcb945d05 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -1420,8 +1420,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1446,7 +1446,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1804,7 +1804,7 @@ public enum Components { case diskUsage = "disk_usage" case collaborators } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.login = try container.decode( Swift.String.self, @@ -2016,7 +2016,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -3031,7 +3031,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case userViewType = "user_view_type" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let discriminator = try container.decode( Swift.String.self, @@ -3050,7 +3050,7 @@ public enum Operations { ) } } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let ._private(value): try value.encode(to: encoder) @@ -5057,8 +5057,8 @@ public enum Operations { case case2([Swift.String]) /// - Remark: Generated from `#/paths/user/emails/POST/requestBody/json/case3`. case case3(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -5083,7 +5083,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -5369,8 +5369,8 @@ public enum Operations { case case2([Swift.String]) /// - Remark: Generated from `#/paths/user/emails/DELETE/requestBody/json/case3`. case case3(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -5395,7 +5395,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -10884,7 +10884,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case userViewType = "user_view_type" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let discriminator = try container.decode( Swift.String.self, @@ -10903,7 +10903,7 @@ public enum Operations { ) } } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let ._private(value): try value.encode(to: encoder) @@ -11275,7 +11275,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case userViewType = "user_view_type" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let discriminator = try container.decode( Swift.String.self, @@ -11294,7 +11294,7 @@ public enum Operations { ) } } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let ._private(value): try value.encode(to: encoder) @@ -11559,10 +11559,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -11579,10 +11579,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -11649,10 +11649,10 @@ public enum Operations { public init(additionalProperties: [String: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -11885,8 +11885,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case2`. case case2(Operations.UsersDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -11905,7 +11905,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -12544,10 +12544,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -12564,10 +12564,10 @@ public enum Operations { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } From 8ad699a3fe03b821a17ddd7de7e06e87b719f22f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:15:46 +0000 Subject: [PATCH 25/33] Commit via running: make Sources/codespaces --- Sources/codespaces/Types.swift | 267 ++++++++++++++++++++++++++++++--- 1 file changed, 248 insertions(+), 19 deletions(-) diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 9b8a0de7c8..bae685b3d4 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -1667,8 +1667,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1693,7 +1693,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -2166,6 +2166,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2411,6 +2430,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2508,6 +2530,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2605,6 +2630,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2703,6 +2731,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2948,6 +2979,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2958,6 +3090,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2965,7 +3100,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2974,6 +3112,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2983,6 +3124,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Minimal Repository @@ -3125,6 +3269,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -3260,10 +3419,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -3341,6 +3500,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3430,6 +3592,9 @@ public enum Components { hasPages: Swift.Bool? = nil, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3519,6 +3684,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3609,6 +3777,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3638,7 +3809,7 @@ public enum Components { public struct EmptyObject: Codable, Hashable, Sendable { /// Creates a new `EmptyObject`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -4393,6 +4564,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -4638,6 +4828,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4735,6 +4928,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4832,6 +5028,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4930,6 +5129,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5135,6 +5337,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/has_discussions`. public var hasDiscussions: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -5331,10 +5548,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -5412,6 +5629,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -5516,6 +5736,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -5620,6 +5843,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -5725,6 +5951,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -7415,14 +7644,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/codespaces/access/selected_users/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members whose codespaces be billed to the organization. + /// The usernames of the organization members and outside collaborators whose codespaces should be billed to the organization. /// /// - Remark: Generated from `#/paths/orgs/{org}/codespaces/access/selected_users/POST/requestBody/json/selected_usernames`. public var selectedUsernames: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedUsernames: The usernames of the organization members whose codespaces be billed to the organization. + /// - selectedUsernames: The usernames of the organization members and outside collaborators whose codespaces should be billed to the organization. public init(selectedUsernames: [Swift.String]) { self.selectedUsernames = selectedUsernames } @@ -7697,14 +7926,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/codespaces/access/selected_users/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members whose codespaces should not be billed to the organization. + /// The usernames of the organization members and outside collaborators whose codespaces should not be billed to the organization. /// /// - Remark: Generated from `#/paths/orgs/{org}/codespaces/access/selected_users/DELETE/requestBody/json/selected_usernames`. public var selectedUsernames: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedUsernames: The usernames of the organization members whose codespaces should not be billed to the organization. + /// - selectedUsernames: The usernames of the organization members and outside collaborators whose codespaces should not be billed to the organization. public init(selectedUsernames: [Swift.String]) { self.selectedUsernames = selectedUsernames } @@ -14288,8 +14517,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case2`. case case2(Operations.CodespacesCreateForAuthenticatedUser.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -14308,7 +14537,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -15071,8 +15300,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -15093,7 +15322,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2 From c4b52596353e45852de90fd699cdcc19ea82c167 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:16:09 +0000 Subject: [PATCH 26/33] Commit via running: make Sources/copilot --- Sources/copilot/Client.swift | 1449 ++++++ Sources/copilot/Types.swift | 8997 +++++++++++++++++++++++++--------- 2 files changed, 8015 insertions(+), 2431 deletions(-) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 99521ac3fd..a70d8b1129 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -1082,6 +1082,1455 @@ public struct Client: APIProtocol { } ) } + /// Get Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + public func copilotGetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + public func copilotSetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions", + 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 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repositories enabled for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotListCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/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: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set selected repositories for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories", + 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 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Enable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotEnableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + 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 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Disable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotDisableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + public func copilotCopilotContentExclusionForOrganization(_ input: Operations.CopilotCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotCopilotContentExclusionForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotCopilotContentExclusionForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/content_exclusion", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotCopilotContentExclusionForOrganization.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.CopilotOrganizationContentExclusionDetails.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can set Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + public func copilotSetCopilotContentExclusionForOrganization(_ input: Operations.CopilotSetCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotSetCopilotContentExclusionForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/content_exclusion", + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.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 .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.TooLarge.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 .contentTooLarge(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get Copilot metrics for an organization /// /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 8c432ff213..8699db47c3 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -117,6 +117,134 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. func copilotCancelCopilotSeatAssignmentForUsers(_ input: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input) async throws -> Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output + /// Get Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + func copilotGetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output + /// Set Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + func copilotSetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output + /// List repositories enabled for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + func copilotListCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output + /// Set selected repositories for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + func copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output + /// Enable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + func copilotEnableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output + /// Disable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + func copilotDisableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output + /// Get Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + func copilotCopilotContentExclusionForOrganization(_ input: Operations.CopilotCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotCopilotContentExclusionForOrganization.Output + /// Set Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can set Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + func copilotSetCopilotContentExclusionForOrganization(_ input: Operations.CopilotSetCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output /// Get Copilot metrics for an organization /// /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. @@ -340,6 +468,206 @@ extension APIProtocol { body: body )) } + /// Get Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + public func copilotGetCopilotCodingAgentPermissionsOrganization( + path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init() + ) async throws -> Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output { + try await copilotGetCopilotCodingAgentPermissionsOrganization(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + public func copilotSetCopilotCodingAgentPermissionsOrganization( + path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + ) async throws -> Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output { + try await copilotSetCopilotCodingAgentPermissionsOrganization(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// List repositories enabled for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotListCopilotCodingAgentSelectedRepositoriesForOrganization( + path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + query: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query = .init(), + headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init() + ) async throws -> Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await copilotListCopilotCodingAgentSelectedRepositoriesForOrganization(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set selected repositories for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization( + path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body + ) async throws -> Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Enable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotEnableCopilotCodingAgentForRepositoryInOrganization( + path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Headers = .init() + ) async throws -> Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output { + try await copilotEnableCopilotCodingAgentForRepositoryInOrganization(Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input( + path: path, + headers: headers + )) + } + /// Disable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotDisableCopilotCodingAgentForRepositoryInOrganization( + path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Headers = .init() + ) async throws -> Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output { + try await copilotDisableCopilotCodingAgentForRepositoryInOrganization(Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input( + path: path, + headers: headers + )) + } + /// Get Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + public func copilotCopilotContentExclusionForOrganization( + path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotCopilotContentExclusionForOrganization.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotContentExclusionForOrganization.Output { + try await copilotCopilotContentExclusionForOrganization(Operations.CopilotCopilotContentExclusionForOrganization.Input( + path: path, + headers: headers + )) + } + /// Set Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can set Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + public func copilotSetCopilotContentExclusionForOrganization( + path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body + ) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output { + try await copilotSetCopilotContentExclusionForOrganization(Operations.CopilotSetCopilotContentExclusionForOrganization.Input( + path: path, + headers: headers, + body: body + )) + } /// Get Copilot metrics for an organization /// /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. @@ -448,92 +776,55 @@ public enum Servers { public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. public enum Schemas { - /// Basic Error - /// - /// - Remark: Generated from `#/components/schemas/basic-error`. - public struct BasicError: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/basic-error/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/basic-error/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/basic-error/status`. - public var status: Swift.String? - /// Creates a new `BasicError`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - url: - /// - status: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - url: Swift.String? = nil, - status: Swift.String? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.url = url - self.status = status - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case url - case status - } - } /// A GitHub user. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct NullableSimpleUser: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + /// - Remark: Generated from `#/components/schemas/simple-user/email`. public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + /// - Remark: Generated from `#/components/schemas/simple-user/login`. public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + /// - Remark: Generated from `#/components/schemas/simple-user/id`. public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. public var gravatarId: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + /// - Remark: Generated from `#/components/schemas/simple-user/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. public var receivedEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + /// - Remark: Generated from `#/components/schemas/simple-user/type`. public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. public var siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starredAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. public var userViewType: Swift.String? - /// Creates a new `NullableSimpleUser`. + /// Creates a new `SimpleUser`. /// /// - Parameters: /// - name: @@ -630,2020 +921,5905 @@ public enum Components { case userViewType = "user_view_type" } } - /// Group of enterprise owners and/or members + /// Basic Error /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct EnterpriseTeam: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. - public var url: Swift.String - /// Retired: this field will not be returned with GHEC enterprise teams. - /// - /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. - public var syncToOrganizations: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. - public var organizationSelectionType: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var groupId: Swift.String? - /// Retired: this field will not be returned with GHEC enterprise teams. - /// - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. - public var groupName: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `EnterpriseTeam`. + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. /// /// - Parameters: - /// - id: - /// - name: - /// - description: - /// - slug: + /// - message: + /// - documentationUrl: /// - url: - /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. - /// - organizationSelectionType: - /// - groupId: - /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. - /// - htmlUrl: - /// - membersUrl: - /// - createdAt: - /// - updatedAt: + /// - status: public init( - id: Swift.Int64, - name: Swift.String, - description: Swift.String? = nil, - slug: Swift.String, - url: Swift.String, - syncToOrganizations: Swift.String? = nil, - organizationSelectionType: Swift.String? = nil, - groupId: Swift.String? = nil, - groupName: Swift.String? = nil, - htmlUrl: Swift.String, - membersUrl: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil ) { - self.id = id - self.name = name - self.description = description - self.slug = slug + self.message = message + self.documentationUrl = documentationUrl self.url = url - self.syncToOrganizations = syncToOrganizations - self.organizationSelectionType = organizationSelectionType - self.groupId = groupId - self.groupName = groupName - self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.createdAt = createdAt - self.updatedAt = updatedAt + self.status = status } public enum CodingKeys: String, CodingKey { - case id - case name - case description - case slug + case message + case documentationUrl = "documentation_url" case url - case syncToOrganizations = "sync_to_organizations" - case organizationSelectionType = "organization_selection_type" - case groupId = "group_id" - case groupName = "group_name" - case htmlUrl = "html_url" - case membersUrl = "members_url" - case createdAt = "created_at" - case updatedAt = "updated_at" + case status } } - /// Groups of organization members that gives permissions on specified repositories. + /// Validation Error Simple /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct NullableTeamSimple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var nodeId: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var membersUrl: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositoriesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldapDn: Swift.String? - /// The ownership type of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case enterprise = "enterprise" - case organization = "organization" - } - /// The ownership type of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. - public var _type: Components.Schemas.NullableTeamSimple._TypePayload - /// Unique identifier of the organization to which this team belongs - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. - public var organizationId: Swift.Int? - /// Unique identifier of the enterprise to which this team belongs - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. - public var enterpriseId: Swift.Int? - /// Creates a new `NullableTeamSimple`. + /// - Remark: Generated from `#/components/schemas/validation-error-simple`. + public struct ValidationErrorSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. + public var errors: [Swift.String]? + /// Creates a new `ValidationErrorSimple`. /// /// - Parameters: - /// - id: Unique identifier of the team - /// - nodeId: - /// - url: URL for the team - /// - membersUrl: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notificationSetting: The notification setting the team has set - /// - htmlUrl: - /// - repositoriesUrl: - /// - slug: - /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment - /// - _type: The ownership type of the team - /// - organizationId: Unique identifier of the organization to which this team belongs - /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + /// - message: + /// - documentationUrl: + /// - errors: public init( - id: Swift.Int, - nodeId: Swift.String, - url: Swift.String, - membersUrl: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - htmlUrl: Swift.String, - repositoriesUrl: Swift.String, - slug: Swift.String, - ldapDn: Swift.String? = nil, - _type: Components.Schemas.NullableTeamSimple._TypePayload, - organizationId: Swift.Int? = nil, - enterpriseId: Swift.Int? = nil + message: Swift.String, + documentationUrl: Swift.String, + errors: [Swift.String]? = nil ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.membersUrl = membersUrl - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notificationSetting = notificationSetting - self.htmlUrl = htmlUrl - self.repositoriesUrl = repositoriesUrl - self.slug = slug - self.ldapDn = ldapDn - self._type = _type - self.organizationId = organizationId - self.enterpriseId = enterpriseId + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case membersUrl = "members_url" - case name - case description - case permission - case privacy - case notificationSetting = "notification_setting" - case htmlUrl = "html_url" - case repositoriesUrl = "repositories_url" - case slug - case ldapDn = "ldap_dn" - case _type = "type" - case organizationId = "organization_id" - case enterpriseId = "enterprise_id" + case message + case documentationUrl = "documentation_url" + case errors } } - /// Groups of organization members that gives permissions on specified repositories. + /// Validation Error /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct Team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `PermissionsPayload`. + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case resource + case field + case message + case code + case index + case value } } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.Team.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositoriesUrl: Swift.String - /// The ownership type of the team + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. /// - /// - Remark: Generated from `#/components/schemas/team/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case enterprise = "enterprise" - case organization = "organization" + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors } - /// The ownership type of the team - /// - /// - Remark: Generated from `#/components/schemas/team/type`. - public var _type: Components.Schemas.Team._TypePayload - /// Unique identifier of the organization to which this team belongs - /// - /// - Remark: Generated from `#/components/schemas/team/organization_id`. - public var organizationId: Swift.Int? - /// Unique identifier of the enterprise to which this team belongs - /// - /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. - public var enterpriseId: Swift.Int? - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.NullableTeamSimple? - /// Creates a new `Team`. + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct NullableSimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `NullableSimpleUser`. /// /// - Parameters: + /// - name: + /// - email: + /// - login: /// - id: /// - nodeId: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notificationSetting: - /// - permission: - /// - permissions: + /// - avatarUrl: + /// - gravatarId: /// - url: /// - htmlUrl: - /// - membersUrl: - /// - repositoriesUrl: - /// - _type: The ownership type of the team - /// - organizationId: Unique identifier of the organization to which this team belongs - /// - enterpriseId: Unique identifier of the enterprise to which this team belongs - /// - parent: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: public init( - id: Swift.Int, + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, nodeId: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.Team.PermissionsPayload? = nil, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, url: Swift.String, htmlUrl: Swift.String, - membersUrl: Swift.String, - repositoriesUrl: Swift.String, - _type: Components.Schemas.Team._TypePayload, - organizationId: Swift.Int? = nil, - enterpriseId: Swift.Int? = nil, - parent: Components.Schemas.NullableTeamSimple? = nil + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil ) { + self.name = name + self.email = email + self.login = login self.id = id self.nodeId = nodeId - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notificationSetting = notificationSetting - self.permission = permission - self.permissions = permissions + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId self.url = url self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.repositoriesUrl = repositoriesUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl self._type = _type - self.organizationId = organizationId - self.enterpriseId = enterpriseId - self.parent = parent + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType } public enum CodingKeys: String, CodingKey { + case name + case email + case login case id case nodeId = "node_id" - case name - case slug - case description - case privacy - case notificationSetting = "notification_setting" - case permission - case permissions + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" case url case htmlUrl = "html_url" - case membersUrl = "members_url" - case repositoriesUrl = "repositories_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" case _type = "type" - case organizationId = "organization_id" - case enterpriseId = "enterprise_id" - case parent + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" } } - /// The breakdown of Copilot Business seats for the organization. + /// Code Of Conduct /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown`. - public struct CopilotOrganizationSeatBreakdown: Codable, Hashable, Sendable { - /// The total number of seats being billed for the organization as of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/total`. - public var total: Swift.Int? - /// Seats added during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/added_this_cycle`. - public var addedThisCycle: Swift.Int? - /// The number of seats that are pending cancellation at the end of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/pending_cancellation`. - public var pendingCancellation: Swift.Int? - /// The number of users who have been invited to receive a Copilot seat through this organization. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/pending_invitation`. - public var pendingInvitation: Swift.Int? - /// The number of seats that have used Copilot during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/active_this_cycle`. - public var activeThisCycle: Swift.Int? - /// The number of seats that have not used Copilot during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/inactive_this_cycle`. - public var inactiveThisCycle: Swift.Int? - /// Creates a new `CopilotOrganizationSeatBreakdown`. + /// - Remark: Generated from `#/components/schemas/code-of-conduct`. + public struct CodeOfConduct: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-of-conduct/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/code-of-conduct/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `CodeOfConduct`. /// /// - Parameters: - /// - total: The total number of seats being billed for the organization as of the current billing cycle. - /// - addedThisCycle: Seats added during the current billing cycle. - /// - pendingCancellation: The number of seats that are pending cancellation at the end of the current billing cycle. - /// - pendingInvitation: The number of users who have been invited to receive a Copilot seat through this organization. - /// - activeThisCycle: The number of seats that have used Copilot during the current billing cycle. - /// - inactiveThisCycle: The number of seats that have not used Copilot during the current billing cycle. + /// - key: + /// - name: + /// - url: + /// - body: + /// - htmlUrl: public init( - total: Swift.Int? = nil, - addedThisCycle: Swift.Int? = nil, - pendingCancellation: Swift.Int? = nil, - pendingInvitation: Swift.Int? = nil, - activeThisCycle: Swift.Int? = nil, - inactiveThisCycle: Swift.Int? = nil + key: Swift.String, + name: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + htmlUrl: Swift.String? = nil ) { - self.total = total - self.addedThisCycle = addedThisCycle - self.pendingCancellation = pendingCancellation - self.pendingInvitation = pendingInvitation - self.activeThisCycle = activeThisCycle - self.inactiveThisCycle = inactiveThisCycle + self.key = key + self.name = name + self.url = url + self.body = body + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { - case total - case addedThisCycle = "added_this_cycle" - case pendingCancellation = "pending_cancellation" - case pendingInvitation = "pending_invitation" - case activeThisCycle = "active_this_cycle" - case inactiveThisCycle = "inactive_this_cycle" + case key + case name + case url + case body + case htmlUrl = "html_url" } } - /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Group of enterprise owners and/or members /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. - public struct CopilotOrganizationDetails: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. - public var seatBreakdown: Components.Schemas.CopilotOrganizationSeatBreakdown - /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// Retired: this field will not be returned with GHEC enterprise teams. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - @frozen public enum PublicCodeSuggestionsPayload: String, Codable, Hashable, Sendable, CaseIterable { - case allow = "allow" - case block = "block" - case unconfigured = "unconfigured" - } - /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - public var publicCodeSuggestions: Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload - /// The organization policy for allowing or disallowing Copilot Chat in the IDE. + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - @frozen public enum IdeChatPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt } - /// The organization policy for allowing or disallowing Copilot Chat in the IDE. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - public var ideChat: Components.Schemas.CopilotOrganizationDetails.IdeChatPayload? - /// The organization policy for allowing or disallowing Copilot features on GitHub.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - @frozen public enum PlatformChatPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" } - /// The organization policy for allowing or disallowing Copilot features on GitHub.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - public var platformChat: Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload? - /// The organization policy for allowing or disallowing Copilot in the CLI. + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - @frozen public enum CliPayload: String, Codable, Hashable, Sendable, CaseIterable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" - } - /// The organization policy for allowing or disallowing Copilot in the CLI. + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - public var cli: Components.Schemas.CopilotOrganizationDetails.CliPayload? - /// The mode of assigning new seats. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - @frozen public enum SeatManagementSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { - case assignAll = "assign_all" - case assignSelected = "assign_selected" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? + /// Creates a new `AdvancedSecurityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } } - /// The mode of assigning new seats. + /// Enable or disable GitHub Advanced Security for the repository. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - public var seatManagementSetting: Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. - @frozen public enum PlanTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case business = "business" - case enterprise = "enterprise" + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct CodeSecurityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? + /// Creates a new `CodeSecurityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } } - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? + /// Enable or disable Dependabot security updates for the repository. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. - public var planType: Components.Schemas.CopilotOrganizationDetails.PlanTypePayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotOrganizationDetails`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public struct DependabotSecurityUpdatesPayload: Codable, Hashable, Sendable { + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + public var status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? + /// Creates a new `DependabotSecurityUpdatesPayload`. + /// + /// - Parameters: + /// - status: The enablement status of Dependabot security updates for the repository. + public init(status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Enable or disable Dependabot security updates for the repository. /// - /// - Parameters: - /// - seatBreakdown: - /// - publicCodeSuggestions: The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). - /// - ideChat: The organization policy for allowing or disallowing Copilot Chat in the IDE. - /// - platformChat: The organization policy for allowing or disallowing Copilot features on GitHub.com. - /// - cli: The organization policy for allowing or disallowing Copilot in the CLI. - /// - seatManagementSetting: The mode of assigning new seats. - /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. - /// - additionalProperties: A container of undocumented properties. - public init( - seatBreakdown: Components.Schemas.CopilotOrganizationSeatBreakdown, - publicCodeSuggestions: Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload, - ideChat: Components.Schemas.CopilotOrganizationDetails.IdeChatPayload? = nil, - platformChat: Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload? = nil, - cli: Components.Schemas.CopilotOrganizationDetails.CliPayload? = nil, - seatManagementSetting: Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload, - planType: Components.Schemas.CopilotOrganizationDetails.PlanTypePayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.seatBreakdown = seatBreakdown - self.publicCodeSuggestions = publicCodeSuggestions - self.ideChat = ideChat - self.platformChat = platformChat - self.cli = cli - self.seatManagementSetting = seatManagementSetting - self.planType = planType - self.additionalProperties = additionalProperties + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public var dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public struct SecretScanningPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? + /// Creates a new `SecretScanningPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } } - public enum CodingKeys: String, CodingKey { - case seatBreakdown = "seat_breakdown" - case publicCodeSuggestions = "public_code_suggestions" - case ideChat = "ide_chat" - case platformChat = "platform_chat" - case cli - case seatManagementSetting = "seat_management_setting" - case planType = "plan_type" + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public var secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public struct SecretScanningPushProtectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? + /// Creates a new `SecretScanningPushProtectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.seatBreakdown = try container.decode( - Components.Schemas.CopilotOrganizationSeatBreakdown.self, - forKey: .seatBreakdown - ) - self.publicCodeSuggestions = try container.decode( - Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload.self, - forKey: .publicCodeSuggestions - ) - self.ideChat = try container.decodeIfPresent( - Components.Schemas.CopilotOrganizationDetails.IdeChatPayload.self, - forKey: .ideChat - ) - self.platformChat = try container.decodeIfPresent( - Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload.self, - forKey: .platformChat - ) - self.cli = try container.decodeIfPresent( - Components.Schemas.CopilotOrganizationDetails.CliPayload.self, - forKey: .cli - ) - self.seatManagementSetting = try container.decode( - Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload.self, - forKey: .seatManagementSetting - ) - self.planType = try container.decodeIfPresent( - Components.Schemas.CopilotOrganizationDetails.PlanTypePayload.self, - forKey: .planType - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "seat_breakdown", - "public_code_suggestions", - "ide_chat", - "platform_chat", - "cli", - "seat_management_setting", - "plan_type" - ]) + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public var secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public struct SecretScanningNonProviderPatternsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? + /// Creates a new `SecretScanningNonProviderPatternsPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - self.seatBreakdown, - forKey: .seatBreakdown - ) - try container.encode( - self.publicCodeSuggestions, - forKey: .publicCodeSuggestions - ) - try container.encodeIfPresent( - self.ideChat, - forKey: .ideChat - ) - try container.encodeIfPresent( - self.platformChat, - forKey: .platformChat - ) - try container.encodeIfPresent( - self.cli, - forKey: .cli - ) - try container.encode( - self.seatManagementSetting, - forKey: .seatManagementSetting - ) - try container.encodeIfPresent( - self.planType, - forKey: .planType - ) - try encoder.encodeAdditionalProperties(additionalProperties) + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public var secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct SecretScanningAiDetectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? + /// Creates a new `SecretScanningAiDetectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? + /// Creates a new `SecurityAndAnalysis`. + /// + /// - Parameters: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. + /// - codeSecurity: + /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. + /// - secretScanning: + /// - secretScanningPushProtection: + /// - secretScanningNonProviderPatterns: + /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: + public init( + advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, + codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, + dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? = nil, + secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, + secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, + secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil + ) { + self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity + self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.secretScanning = secretScanning + self.secretScanningPushProtection = secretScanningPushProtection + self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns + self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions + } + public enum CodingKeys: String, CodingKey { + case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" + case dependabotSecurityUpdates = "dependabot_security_updates" + case secretScanning = "secret_scanning" + case secretScanningPushProtection = "secret_scanning_push_protection" + case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" + case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } - /// A GitHub organization. + /// Minimal Repository /// - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple`. - public struct NullableOrganizationSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/minimal-repository`. + public struct MinimalRepository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/url`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/events_url`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/events_url`. public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/hooks_url`. - public var hooksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/issues_url`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_url`. + public var gitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issues_url`. public var issuesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/public_members_url`. - public var publicMembersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/description`. - public var description: Swift.String? - /// Creates a new `NullableOrganizationSimple`. + /// - Remark: Generated from `#/components/schemas/minimal-repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/ssh_url`. + public var sshUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/clone_url`. + public var cloneUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/svn_url`. + public var svnUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_count`. + public var forksCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_count`. + public var stargazersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers_count`. + public var watchersCount: Swift.Int? + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/size`. + public var size: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/default_branch`. + public var defaultBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues_count`. + public var openIssuesCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/topics`. + public var topics: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_issues`. + public var hasIssues: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_projects`. + public var hasProjects: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_wiki`. + public var hasWiki: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pages`. + public var hasPages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_downloads`. + public var hasDownloads: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. + public var archived: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. + public var disabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/admin`. + public var admin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/push`. + public var push: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/pull`. + public var pull: Swift.Bool? + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - maintain: + /// - push: + /// - triage: + /// - pull: + public init( + admin: Swift.Bool? = nil, + maintain: Swift.Bool? = nil, + push: Swift.Bool? = nil, + triage: Swift.Bool? = nil, + pull: Swift.Bool? = nil + ) { + self.admin = admin + self.maintain = maintain + self.push = push + self.triage = triage + self.pull = pull + } + public enum CodingKeys: String, CodingKey { + case admin + case maintain + case push + case triage + case pull + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public var permissions: Components.Schemas.MinimalRepository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/role_name`. + public var roleName: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_count`. + public var subscribersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/network_count`. + public var networkCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/code_of_conduct`. + public var codeOfConduct: Components.Schemas.CodeOfConduct? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public struct LicensePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/key`. + public var key: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/spdx_id`. + public var spdxId: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/node_id`. + public var nodeId: Swift.String? + /// Creates a new `LicensePayload`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - spdxId: + /// - url: + /// - nodeId: + public init( + key: Swift.String? = nil, + name: Swift.String? = nil, + spdxId: Swift.String? = nil, + url: Swift.String? = nil, + nodeId: Swift.String? = nil + ) { + self.key = key + self.name = name + self.spdxId = spdxId + self.url = url + self.nodeId = nodeId + } + public enum CodingKeys: String, CodingKey { + case key + case name + case spdxId = "spdx_id" + case url + case nodeId = "node_id" + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public var license: Components.Schemas.MinimalRepository.LicensePayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks`. + public var forks: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues`. + public var openIssues: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers`. + public var watchers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/allow_forking`. + public var allowForking: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. + public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? + /// Creates a new `MinimalRepository`. /// /// - Parameters: - /// - login: /// - id: /// - nodeId: + /// - name: + /// - fullName: + /// - owner: + /// - _private: + /// - htmlUrl: + /// - description: + /// - fork: /// - url: - /// - reposUrl: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: /// - eventsUrl: - /// - hooksUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: /// - issuesUrl: - /// - membersUrl: - /// - publicMembersUrl: - /// - avatarUrl: - /// - description: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: + /// - openIssuesCount: + /// - isTemplate: + /// - topics: + /// - hasIssues: + /// - hasProjects: + /// - hasWiki: + /// - hasPages: + /// - hasDownloads: + /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: + /// - archived: + /// - disabled: + /// - visibility: + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - permissions: + /// - roleName: + /// - tempCloneToken: + /// - deleteBranchOnMerge: + /// - subscribersCount: + /// - networkCount: + /// - codeOfConduct: + /// - license: + /// - forks: + /// - openIssues: + /// - watchers: + /// - allowForking: + /// - webCommitSignoffRequired: + /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( - login: Swift.String, - id: Swift.Int, + id: Swift.Int64, nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, url: Swift.String, - reposUrl: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, eventsUrl: Swift.String, - hooksUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String? = nil, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, issuesUrl: Swift.String, - membersUrl: Swift.String, - publicMembersUrl: Swift.String, - avatarUrl: Swift.String, - description: Swift.String? = nil + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String? = nil, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String? = nil, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String? = nil, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int? = nil, + stargazersCount: Swift.Int? = nil, + watchersCount: Swift.Int? = nil, + size: Swift.Int? = nil, + defaultBranch: Swift.String? = nil, + openIssuesCount: Swift.Int? = nil, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool? = nil, + hasProjects: Swift.Bool? = nil, + hasWiki: Swift.Bool? = nil, + hasPages: Swift.Bool? = nil, + hasDownloads: Swift.Bool? = nil, + hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, + archived: Swift.Bool? = nil, + disabled: Swift.Bool? = nil, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + permissions: Components.Schemas.MinimalRepository.PermissionsPayload? = nil, + roleName: Swift.String? = nil, + tempCloneToken: Swift.String? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + subscribersCount: Swift.Int? = nil, + networkCount: Swift.Int? = nil, + codeOfConduct: Components.Schemas.CodeOfConduct? = nil, + license: Components.Schemas.MinimalRepository.LicensePayload? = nil, + forks: Swift.Int? = nil, + openIssues: Swift.Int? = nil, + watchers: Swift.Int? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { - self.login = login self.id = id self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork self.url = url - self.reposUrl = reposUrl + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl self.eventsUrl = eventsUrl - self.hooksUrl = hooksUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl self.issuesUrl = issuesUrl - self.membersUrl = membersUrl - self.publicMembersUrl = publicMembersUrl - self.avatarUrl = avatarUrl - self.description = description + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.permissions = permissions + self.roleName = roleName + self.tempCloneToken = tempCloneToken + self.deleteBranchOnMerge = deleteBranchOnMerge + self.subscribersCount = subscribersCount + self.networkCount = networkCount + self.codeOfConduct = codeOfConduct + self.license = license + self.forks = forks + self.openIssues = openIssues + self.watchers = watchers + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { - case login case id case nodeId = "node_id" + case name + case fullName = "full_name" + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork case url - case reposUrl = "repos_url" + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" case eventsUrl = "events_url" - case hooksUrl = "hooks_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" case issuesUrl = "issues_url" - case membersUrl = "members_url" - case publicMembersUrl = "public_members_url" - case avatarUrl = "avatar_url" - case description + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case roleName = "role_name" + case tempCloneToken = "temp_clone_token" + case deleteBranchOnMerge = "delete_branch_on_merge" + case subscribersCount = "subscribers_count" + case networkCount = "network_count" + case codeOfConduct = "code_of_conduct" + case license + case forks + case openIssues = "open_issues" + case watchers + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } - /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. - public struct CopilotSeatDetails: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - public var organization: Components.Schemas.NullableOrganizationSimple? - /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - @frozen public enum AssigningTeamPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. - case Team(Components.Schemas.Team) - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. - case EnterpriseTeam(Components.Schemas.EnterpriseTeam) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .Team(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EnterpriseTeam(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .Team(value): - try value.encode(to: encoder) - case let .EnterpriseTeam(value): - try value.encode(to: encoder) - } - } - } - /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var nodeId: Swift.String + /// URL for the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - public var assigningTeam: Components.Schemas.CopilotSeatDetails.AssigningTeamPayload? - /// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var membersUrl: Swift.String + /// Name of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. - public var pendingCancellationDate: Swift.String? - /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_at`. - public var lastActivityAt: Foundation.Date? - /// Last editor that was used by the user for a GitHub Copilot completion. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. - public var lastActivityEditor: Swift.String? - /// Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_authenticated_at`. - public var lastAuthenticatedAt: Foundation.Date? - /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. - public var createdAt: Foundation.Date - /// **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. - @available(*, deprecated) - public var updatedAt: Foundation.Date? - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldapDn: Swift.String? + /// The ownership type of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. - @frozen public enum PlanTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case business = "business" + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { case enterprise = "enterprise" - case unknown = "unknown" + case organization = "organization" } - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// The ownership type of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. - public var planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? - /// Creates a new `CopilotSeatDetails`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? + /// Creates a new `NullableTeamSimple`. /// /// - Parameters: - /// - assignee: - /// - organization: - /// - assigningTeam: The team through which the assignee is granted access to GitHub Copilot, if applicable. - /// - pendingCancellationDate: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. - /// - lastActivityAt: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. - /// - lastActivityEditor: Last editor that was used by the user for a GitHub Copilot completion. - /// - lastAuthenticatedAt: Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. - /// - createdAt: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. - /// - updatedAt: **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. - /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - id: Unique identifier of the team + /// - nodeId: + /// - url: URL for the team + /// - membersUrl: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notificationSetting: The notification setting the team has set + /// - htmlUrl: + /// - repositoriesUrl: + /// - slug: + /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( - assignee: Components.Schemas.NullableSimpleUser? = nil, - organization: Components.Schemas.NullableOrganizationSimple? = nil, - assigningTeam: Components.Schemas.CopilotSeatDetails.AssigningTeamPayload? = nil, - pendingCancellationDate: Swift.String? = nil, - lastActivityAt: Foundation.Date? = nil, - lastActivityEditor: Swift.String? = nil, - lastAuthenticatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date? = nil, - planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? = nil + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + membersUrl: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + htmlUrl: Swift.String, + repositoriesUrl: Swift.String, + slug: Swift.String, + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { - self.assignee = assignee - self.organization = organization - self.assigningTeam = assigningTeam - self.pendingCancellationDate = pendingCancellationDate - self.lastActivityAt = lastActivityAt - self.lastActivityEditor = lastActivityEditor - self.lastAuthenticatedAt = lastAuthenticatedAt - self.createdAt = createdAt - self.updatedAt = updatedAt - self.planType = planType + self.id = id + self.nodeId = nodeId + self.url = url + self.membersUrl = membersUrl + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notificationSetting = notificationSetting + self.htmlUrl = htmlUrl + self.repositoriesUrl = repositoriesUrl + self.slug = slug + self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { - case assignee - case organization - case assigningTeam = "assigning_team" - case pendingCancellationDate = "pending_cancellation_date" - case lastActivityAt = "last_activity_at" - case lastActivityEditor = "last_activity_editor" - case lastAuthenticatedAt = "last_authenticated_at" - case createdAt = "created_at" - case updatedAt = "updated_at" - case planType = "plan_type" - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.assignee = try container.decodeIfPresent( - Components.Schemas.NullableSimpleUser.self, - forKey: .assignee - ) - self.organization = try container.decodeIfPresent( - Components.Schemas.NullableOrganizationSimple.self, - forKey: .organization - ) - self.assigningTeam = try container.decodeIfPresent( - Components.Schemas.CopilotSeatDetails.AssigningTeamPayload.self, - forKey: .assigningTeam - ) - self.pendingCancellationDate = try container.decodeIfPresent( - Swift.String.self, - forKey: .pendingCancellationDate - ) - self.lastActivityAt = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .lastActivityAt - ) - self.lastActivityEditor = try container.decodeIfPresent( - Swift.String.self, - forKey: .lastActivityEditor - ) - self.lastAuthenticatedAt = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .lastAuthenticatedAt - ) - self.createdAt = try container.decode( - Foundation.Date.self, - forKey: .createdAt - ) - self.updatedAt = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .updatedAt - ) - self.planType = try container.decodeIfPresent( - Components.Schemas.CopilotSeatDetails.PlanTypePayload.self, - forKey: .planType - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "assignee", - "organization", - "assigning_team", - "pending_cancellation_date", - "last_activity_at", - "last_activity_editor", - "last_authenticated_at", - "created_at", - "updated_at", - "plan_type" - ]) + case id + case nodeId = "node_id" + case url + case membersUrl = "members_url" + case name + case description + case permission + case privacy + case notificationSetting = "notification_setting" + case htmlUrl = "html_url" + case repositoriesUrl = "repositories_url" + case slug + case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } - /// Usage metrics for Copilot editor code completions in the IDE. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions`. - public struct CopilotIdeCodeCompletions: Codable, Hashable, Sendable { - /// Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Usage metrics for a given language for the given editor for Copilot code completions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload`. - public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { - /// Name of the language used for Copilot code completion suggestions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Creates a new `LanguagesPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/team`. + public struct Team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - name: Name of the language used for Copilot code completion suggestions. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" + case pull + case triage + case push + case maintain + case admin } } - /// Code completion metrics for active languages. + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.Team.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositoriesUrl: Swift.String + /// The ownership type of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. - public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayloadPayload] - /// Code completion metrics for active languages. + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. - public var languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? - /// Copilot code completion metrics for active editors. + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload`. - public struct EditorsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Usage metrics for a given language for the given editor for Copilot code completions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload`. - public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { - /// Name of the language used for Copilot code completion suggestions, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// The number of Copilot code suggestions generated for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_suggestions`. - public var totalCodeSuggestions: Swift.Int? - /// The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_acceptances`. - public var totalCodeAcceptances: Swift.Int? - /// The number of lines of code suggested by Copilot code completions for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_suggested`. - public var totalCodeLinesSuggested: Swift.Int? - /// The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_accepted`. - public var totalCodeLinesAccepted: Swift.Int? - /// Creates a new `LanguagesPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. - /// - totalCodeSuggestions: The number of Copilot code suggestions generated for the given editor, for the given language. - /// - totalCodeAcceptances: The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. - /// - totalCodeLinesSuggested: The number of lines of code suggested by Copilot code completions for the given editor, for the given language. - /// - totalCodeLinesAccepted: The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalCodeSuggestions: Swift.Int? = nil, - totalCodeAcceptances: Swift.Int? = nil, - totalCodeLinesSuggested: Swift.Int? = nil, - totalCodeLinesAccepted: Swift.Int? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.totalCodeSuggestions = totalCodeSuggestions - self.totalCodeAcceptances = totalCodeAcceptances - self.totalCodeLinesSuggested = totalCodeLinesSuggested - self.totalCodeLinesAccepted = totalCodeLinesAccepted - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case totalCodeSuggestions = "total_code_suggestions" - case totalCodeAcceptances = "total_code_acceptances" - case totalCodeLinesSuggested = "total_code_lines_suggested" - case totalCodeLinesAccepted = "total_code_lines_accepted" - } - } - /// Code completion metrics for active languages, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. - public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayloadPayload] - /// Code completion metrics for active languages, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. - public var languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. - /// - languages: Code completion metrics for active languages, for the given editor. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalEngagedUsers = totalEngagedUsers - self.languages = languages - } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case languages - } - } - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. - public var models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `EditorsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the given editor. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. - /// - models: List of model metrics for custom models and the default model. - /// - additionalProperties: A container of undocumented properties. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.name = try container.decodeIfPresent( - Swift.String.self, - forKey: .name - ) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.models = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload.self, - forKey: .models - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "name", - "total_engaged_users", - "models" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.name, - forKey: .name - ) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.models, - forKey: .models - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. - public typealias EditorsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. - public var editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotIdeCodeCompletions`. + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.NullableTeamSimple? + /// Creates a new `Team`. /// /// - Parameters: - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. - /// - languages: Code completion metrics for active languages. - /// - editors: - /// - additionalProperties: A container of undocumented properties. + /// - id: + /// - nodeId: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notificationSetting: + /// - permission: + /// - permissions: + /// - url: + /// - htmlUrl: + /// - membersUrl: + /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + /// - parent: public init( - totalEngagedUsers: Swift.Int? = nil, - languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? = nil, - editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.Team.PermissionsPayload? = nil, + url: Swift.String, + htmlUrl: Swift.String, + membersUrl: Swift.String, + repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, + parent: Components.Schemas.NullableTeamSimple? = nil ) { - self.totalEngagedUsers = totalEngagedUsers - self.languages = languages - self.editors = editors - self.additionalProperties = additionalProperties + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.permissions = permissions + self.url = url + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId + self.parent = parent } public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case languages - case editors - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.languages = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload.self, - forKey: .languages - ) - self.editors = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload.self, - forKey: .editors - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "languages", - "editors" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.languages, - forKey: .languages - ) - try container.encodeIfPresent( - self.editors, - forKey: .editors - ) - try encoder.encodeAdditionalProperties(additionalProperties) + case id + case nodeId = "node_id" + case name + case slug + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case permissions + case url + case htmlUrl = "html_url" + case membersUrl = "members_url" + case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + case parent } } - /// Usage metrics for Copilot Chat in the IDE. + /// The breakdown of Copilot Business seats for the organization. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat`. - public struct CopilotIdeChat: Codable, Hashable, Sendable { - /// Total number of users who prompted Copilot Chat in the IDE. + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown`. + public struct CopilotOrganizationSeatBreakdown: Codable, Hashable, Sendable { + /// The total number of seats being billed for the organization as of the current billing cycle. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Copilot Chat metrics, for active editors. + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/total`. + public var total: Swift.Int? + /// Seats added during the current billing cycle. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload`. - public struct EditorsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/name`. - public var name: Swift.String? - /// The number of users who prompted Copilot Chat in the specified editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// The number of users who prompted Copilot Chat in the given editor and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// The total number of chats initiated by users in the given editor and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chats`. - public var totalChats: Swift.Int? - /// The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_insertion_events`. - public var totalChatInsertionEvents: Swift.Int? - /// The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_copy_events`. - public var totalChatCopyEvents: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the given editor and model. - /// - totalChats: The total number of chats initiated by users in the given editor and model. - /// - totalChatInsertionEvents: The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. - /// - totalChatCopyEvents: The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/added_this_cycle`. + public var addedThisCycle: Swift.Int? + /// The number of seats that are pending cancellation at the end of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/pending_cancellation`. + public var pendingCancellation: Swift.Int? + /// The number of users who have been invited to receive a Copilot seat through this organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/pending_invitation`. + public var pendingInvitation: Swift.Int? + /// The number of seats that have used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/active_this_cycle`. + public var activeThisCycle: Swift.Int? + /// The number of seats that have not used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown/inactive_this_cycle`. + public var inactiveThisCycle: Swift.Int? + /// Creates a new `CopilotOrganizationSeatBreakdown`. + /// + /// - Parameters: + /// - total: The total number of seats being billed for the organization as of the current billing cycle. + /// - addedThisCycle: Seats added during the current billing cycle. + /// - pendingCancellation: The number of seats that are pending cancellation at the end of the current billing cycle. + /// - pendingInvitation: The number of users who have been invited to receive a Copilot seat through this organization. + /// - activeThisCycle: The number of seats that have used Copilot during the current billing cycle. + /// - inactiveThisCycle: The number of seats that have not used Copilot during the current billing cycle. + public init( + total: Swift.Int? = nil, + addedThisCycle: Swift.Int? = nil, + pendingCancellation: Swift.Int? = nil, + pendingInvitation: Swift.Int? = nil, + activeThisCycle: Swift.Int? = nil, + inactiveThisCycle: Swift.Int? = nil + ) { + self.total = total + self.addedThisCycle = addedThisCycle + self.pendingCancellation = pendingCancellation + self.pendingInvitation = pendingInvitation + self.activeThisCycle = activeThisCycle + self.inactiveThisCycle = inactiveThisCycle + } + public enum CodingKeys: String, CodingKey { + case total + case addedThisCycle = "added_this_cycle" + case pendingCancellation = "pending_cancellation" + case pendingInvitation = "pending_invitation" + case activeThisCycle = "active_this_cycle" + case inactiveThisCycle = "inactive_this_cycle" + } + } + /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. + public struct CopilotOrganizationDetails: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. + public var seatBreakdown: Components.Schemas.CopilotOrganizationSeatBreakdown + /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + @frozen public enum PublicCodeSuggestionsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case allow = "allow" + case block = "block" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + public var publicCodeSuggestions: Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload + /// The organization policy for allowing or disallowing Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + @frozen public enum IdeChatPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + public var ideChat: Components.Schemas.CopilotOrganizationDetails.IdeChatPayload? + /// The organization policy for allowing or disallowing Copilot features on GitHub.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + @frozen public enum PlatformChatPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing Copilot features on GitHub.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + public var platformChat: Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload? + /// The organization policy for allowing or disallowing Copilot CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + @frozen public enum CliPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing Copilot CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + public var cli: Components.Schemas.CopilotOrganizationDetails.CliPayload? + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + @frozen public enum SeatManagementSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case assignAll = "assign_all" + case assignSelected = "assign_selected" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + public var seatManagementSetting: Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + @frozen public enum PlanTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case business = "business" + case enterprise = "enterprise" + } + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + public var planType: Components.Schemas.CopilotOrganizationDetails.PlanTypePayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotOrganizationDetails`. + /// + /// - Parameters: + /// - seatBreakdown: + /// - publicCodeSuggestions: The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// - ideChat: The organization policy for allowing or disallowing Copilot Chat in the IDE. + /// - platformChat: The organization policy for allowing or disallowing Copilot features on GitHub.com. + /// - cli: The organization policy for allowing or disallowing Copilot CLI. + /// - seatManagementSetting: The mode of assigning new seats. + /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - additionalProperties: A container of undocumented properties. + public init( + seatBreakdown: Components.Schemas.CopilotOrganizationSeatBreakdown, + publicCodeSuggestions: Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload, + ideChat: Components.Schemas.CopilotOrganizationDetails.IdeChatPayload? = nil, + platformChat: Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload? = nil, + cli: Components.Schemas.CopilotOrganizationDetails.CliPayload? = nil, + seatManagementSetting: Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload, + planType: Components.Schemas.CopilotOrganizationDetails.PlanTypePayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.seatBreakdown = seatBreakdown + self.publicCodeSuggestions = publicCodeSuggestions + self.ideChat = ideChat + self.platformChat = platformChat + self.cli = cli + self.seatManagementSetting = seatManagementSetting + self.planType = planType + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case seatBreakdown = "seat_breakdown" + case publicCodeSuggestions = "public_code_suggestions" + case ideChat = "ide_chat" + case platformChat = "platform_chat" + case cli + case seatManagementSetting = "seat_management_setting" + case planType = "plan_type" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.seatBreakdown = try container.decode( + Components.Schemas.CopilotOrganizationSeatBreakdown.self, + forKey: .seatBreakdown + ) + self.publicCodeSuggestions = try container.decode( + Components.Schemas.CopilotOrganizationDetails.PublicCodeSuggestionsPayload.self, + forKey: .publicCodeSuggestions + ) + self.ideChat = try container.decodeIfPresent( + Components.Schemas.CopilotOrganizationDetails.IdeChatPayload.self, + forKey: .ideChat + ) + self.platformChat = try container.decodeIfPresent( + Components.Schemas.CopilotOrganizationDetails.PlatformChatPayload.self, + forKey: .platformChat + ) + self.cli = try container.decodeIfPresent( + Components.Schemas.CopilotOrganizationDetails.CliPayload.self, + forKey: .cli + ) + self.seatManagementSetting = try container.decode( + Components.Schemas.CopilotOrganizationDetails.SeatManagementSettingPayload.self, + forKey: .seatManagementSetting + ) + self.planType = try container.decodeIfPresent( + Components.Schemas.CopilotOrganizationDetails.PlanTypePayload.self, + forKey: .planType + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "seat_breakdown", + "public_code_suggestions", + "ide_chat", + "platform_chat", + "cli", + "seat_management_setting", + "plan_type" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.seatBreakdown, + forKey: .seatBreakdown + ) + try container.encode( + self.publicCodeSuggestions, + forKey: .publicCodeSuggestions + ) + try container.encodeIfPresent( + self.ideChat, + forKey: .ideChat + ) + try container.encodeIfPresent( + self.platformChat, + forKey: .platformChat + ) + try container.encodeIfPresent( + self.cli, + forKey: .cli + ) + try container.encode( + self.seatManagementSetting, + forKey: .seatManagementSetting + ) + try container.encodeIfPresent( + self.planType, + forKey: .planType + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// A GitHub organization. + /// + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple`. + public struct NullableOrganizationSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/public_members_url`. + public var publicMembersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/description`. + public var description: Swift.String? + /// Creates a new `NullableOrganizationSimple`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - nodeId: + /// - url: + /// - reposUrl: + /// - eventsUrl: + /// - hooksUrl: + /// - issuesUrl: + /// - membersUrl: + /// - publicMembersUrl: + /// - avatarUrl: + /// - description: + public init( + login: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + hooksUrl: Swift.String, + issuesUrl: Swift.String, + membersUrl: Swift.String, + publicMembersUrl: Swift.String, + avatarUrl: Swift.String, + description: Swift.String? = nil + ) { + self.login = login + self.id = id + self.nodeId = nodeId + self.url = url + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.hooksUrl = hooksUrl + self.issuesUrl = issuesUrl + self.membersUrl = membersUrl + self.publicMembersUrl = publicMembersUrl + self.avatarUrl = avatarUrl + self.description = description + } + public enum CodingKeys: String, CodingKey { + case login + case id + case nodeId = "node_id" + case url + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case hooksUrl = "hooks_url" + case issuesUrl = "issues_url" + case membersUrl = "members_url" + case publicMembersUrl = "public_members_url" + case avatarUrl = "avatar_url" + case description + } + } + /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. + public struct CopilotSeatDetails: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. + public var organization: Components.Schemas.NullableOrganizationSimple? + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + @frozen public enum AssigningTeamPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. + case Team(Components.Schemas.Team) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. + case EnterpriseTeam(Components.Schemas.EnterpriseTeam) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .Team(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EnterpriseTeam(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .Team(value): + try value.encode(to: encoder) + case let .EnterpriseTeam(value): + try value.encode(to: encoder) + } + } + } + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + public var assigningTeam: Components.Schemas.CopilotSeatDetails.AssigningTeamPayload? + /// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. + public var pendingCancellationDate: Swift.String? + /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_at`. + public var lastActivityAt: Foundation.Date? + /// Last editor that was used by the user for a GitHub Copilot completion. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. + public var lastActivityEditor: Swift.String? + /// Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_authenticated_at`. + public var lastAuthenticatedAt: Foundation.Date? + /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. + public var createdAt: Foundation.Date + /// **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. + @available(*, deprecated) + public var updatedAt: Foundation.Date? + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. + @frozen public enum PlanTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case business = "business" + case enterprise = "enterprise" + case unknown = "unknown" + } + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. + public var planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? + /// Creates a new `CopilotSeatDetails`. + /// + /// - Parameters: + /// - assignee: + /// - organization: + /// - assigningTeam: The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// - pendingCancellationDate: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + /// - lastActivityAt: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// - lastActivityEditor: Last editor that was used by the user for a GitHub Copilot completion. + /// - lastAuthenticatedAt: Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. + /// - createdAt: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// - updatedAt: **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. + public init( + assignee: Components.Schemas.NullableSimpleUser? = nil, + organization: Components.Schemas.NullableOrganizationSimple? = nil, + assigningTeam: Components.Schemas.CopilotSeatDetails.AssigningTeamPayload? = nil, + pendingCancellationDate: Swift.String? = nil, + lastActivityAt: Foundation.Date? = nil, + lastActivityEditor: Swift.String? = nil, + lastAuthenticatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date? = nil, + planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? = nil + ) { + self.assignee = assignee + self.organization = organization + self.assigningTeam = assigningTeam + self.pendingCancellationDate = pendingCancellationDate + self.lastActivityAt = lastActivityAt + self.lastActivityEditor = lastActivityEditor + self.lastAuthenticatedAt = lastAuthenticatedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.planType = planType + } + public enum CodingKeys: String, CodingKey { + case assignee + case organization + case assigningTeam = "assigning_team" + case pendingCancellationDate = "pending_cancellation_date" + case lastActivityAt = "last_activity_at" + case lastActivityEditor = "last_activity_editor" + case lastAuthenticatedAt = "last_authenticated_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case planType = "plan_type" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.assignee = try container.decodeIfPresent( + Components.Schemas.NullableSimpleUser.self, + forKey: .assignee + ) + self.organization = try container.decodeIfPresent( + Components.Schemas.NullableOrganizationSimple.self, + forKey: .organization + ) + self.assigningTeam = try container.decodeIfPresent( + Components.Schemas.CopilotSeatDetails.AssigningTeamPayload.self, + forKey: .assigningTeam + ) + self.pendingCancellationDate = try container.decodeIfPresent( + Swift.String.self, + forKey: .pendingCancellationDate + ) + self.lastActivityAt = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .lastActivityAt + ) + self.lastActivityEditor = try container.decodeIfPresent( + Swift.String.self, + forKey: .lastActivityEditor + ) + self.lastAuthenticatedAt = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .lastAuthenticatedAt + ) + self.createdAt = try container.decode( + Foundation.Date.self, + forKey: .createdAt + ) + self.updatedAt = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .updatedAt + ) + self.planType = try container.decodeIfPresent( + Components.Schemas.CopilotSeatDetails.PlanTypePayload.self, + forKey: .planType + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "assignee", + "organization", + "assigning_team", + "pending_cancellation_date", + "last_activity_at", + "last_activity_editor", + "last_authenticated_at", + "created_at", + "updated_at", + "plan_type" + ]) + } + } + /// List all Copilot Content Exclusion rules for an organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-content-exclusion-details`. + public struct CopilotOrganizationContentExclusionDetails: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: [Swift.String]] + /// Creates a new `CopilotOrganizationContentExclusionDetails`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: [Swift.String]] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Usage metrics for Copilot editor code completions in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions`. + public struct CopilotIdeCodeCompletions: Codable, Hashable, Sendable { + /// Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Usage metrics for a given language for the given editor for Copilot code completions. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload`. + public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Creates a new `LanguagesPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions. + /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. + public init( + name: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil + ) { + self.name = name + self.totalEngagedUsers = totalEngagedUsers + } + public enum CodingKeys: String, CodingKey { + case name + case totalEngagedUsers = "total_engaged_users" + } + } + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayloadPayload] + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public var languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? + /// Copilot code completion metrics for active editors. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload`. + public struct EditorsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload`. + public struct ModelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/is_custom_model`. + public var isCustomModel: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/custom_model_training_date`. + public var customModelTrainingDate: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Usage metrics for a given language for the given editor for Copilot code completions. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload`. + public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// The number of Copilot code suggestions generated for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_suggestions`. + public var totalCodeSuggestions: Swift.Int? + /// The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_acceptances`. + public var totalCodeAcceptances: Swift.Int? + /// The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_suggested`. + public var totalCodeLinesSuggested: Swift.Int? + /// The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_accepted`. + public var totalCodeLinesAccepted: Swift.Int? + /// Creates a new `LanguagesPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. + /// - totalCodeSuggestions: The number of Copilot code suggestions generated for the given editor, for the given language. + /// - totalCodeAcceptances: The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + /// - totalCodeLinesSuggested: The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + /// - totalCodeLinesAccepted: The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. + public init( + name: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + totalCodeSuggestions: Swift.Int? = nil, + totalCodeAcceptances: Swift.Int? = nil, + totalCodeLinesSuggested: Swift.Int? = nil, + totalCodeLinesAccepted: Swift.Int? = nil + ) { + self.name = name + self.totalEngagedUsers = totalEngagedUsers + self.totalCodeSuggestions = totalCodeSuggestions + self.totalCodeAcceptances = totalCodeAcceptances + self.totalCodeLinesSuggested = totalCodeLinesSuggested + self.totalCodeLinesAccepted = totalCodeLinesAccepted + } + public enum CodingKeys: String, CodingKey { + case name + case totalEngagedUsers = "total_engaged_users" + case totalCodeSuggestions = "total_code_suggestions" + case totalCodeAcceptances = "total_code_acceptances" + case totalCodeLinesSuggested = "total_code_lines_suggested" + case totalCodeLinesAccepted = "total_code_lines_accepted" + } + } + /// Code completion metrics for active languages, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. + public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayloadPayload] + /// Code completion metrics for active languages, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. + public var languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? + /// Creates a new `ModelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// - isCustomModel: Indicates whether a model is custom or default. + /// - customModelTrainingDate: The training date for the custom model. + /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. + /// - languages: Code completion metrics for active languages, for the given editor. + public init( + name: Swift.String? = nil, + isCustomModel: Swift.Bool? = nil, + customModelTrainingDate: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? = nil + ) { + self.name = name + self.isCustomModel = isCustomModel + self.customModelTrainingDate = customModelTrainingDate + self.totalEngagedUsers = totalEngagedUsers + self.languages = languages + } + public enum CodingKeys: String, CodingKey { + case name + case isCustomModel = "is_custom_model" + case customModelTrainingDate = "custom_model_training_date" + case totalEngagedUsers = "total_engaged_users" + case languages + } + } + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. + public typealias ModelsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload] + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. + public var models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `EditorsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the given editor. + /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. + /// - models: List of model metrics for custom models and the default model. + /// - additionalProperties: A container of undocumented properties. + public init( + name: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.name = name + self.totalEngagedUsers = totalEngagedUsers + self.models = models + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case name + case totalEngagedUsers = "total_engaged_users" + case models + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.models = try container.decodeIfPresent( + Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload.self, + forKey: .models + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "name", + "total_engaged_users", + "models" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.name, + forKey: .name + ) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.models, + forKey: .models + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public typealias EditorsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public var editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotIdeCodeCompletions`. + /// + /// - Parameters: + /// - totalEngagedUsers: Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. + /// - languages: Code completion metrics for active languages. + /// - editors: + /// - additionalProperties: A container of undocumented properties. + public init( + totalEngagedUsers: Swift.Int? = nil, + languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? = nil, + editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.totalEngagedUsers = totalEngagedUsers + self.languages = languages + self.editors = editors + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case totalEngagedUsers = "total_engaged_users" + case languages + case editors + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.languages = try container.decodeIfPresent( + Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload.self, + forKey: .languages + ) + self.editors = try container.decodeIfPresent( + Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload.self, + forKey: .editors + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "languages", + "editors" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.languages, + forKey: .languages + ) + try container.encodeIfPresent( + self.editors, + forKey: .editors + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Usage metrics for Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat`. + public struct CopilotIdeChat: Codable, Hashable, Sendable { + /// Total number of users who prompted Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Copilot Chat metrics, for active editors. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload`. + public struct EditorsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/name`. + public var name: Swift.String? + /// The number of users who prompted Copilot Chat in the specified editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload`. + public struct ModelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/is_custom_model`. + public var isCustomModel: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/custom_model_training_date`. + public var customModelTrainingDate: Swift.String? + /// The number of users who prompted Copilot Chat in the given editor and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// The total number of chats initiated by users in the given editor and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chats`. + public var totalChats: Swift.Int? + /// The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_insertion_events`. + public var totalChatInsertionEvents: Swift.Int? + /// The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_copy_events`. + public var totalChatCopyEvents: Swift.Int? + /// Creates a new `ModelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. + /// - isCustomModel: Indicates whether a model is custom or default. + /// - customModelTrainingDate: The training date for the custom model. + /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the given editor and model. + /// - totalChats: The total number of chats initiated by users in the given editor and model. + /// - totalChatInsertionEvents: The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + /// - totalChatCopyEvents: The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + public init( + name: Swift.String? = nil, + isCustomModel: Swift.Bool? = nil, + customModelTrainingDate: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + totalChats: Swift.Int? = nil, + totalChatInsertionEvents: Swift.Int? = nil, + totalChatCopyEvents: Swift.Int? = nil + ) { + self.name = name + self.isCustomModel = isCustomModel + self.customModelTrainingDate = customModelTrainingDate + self.totalEngagedUsers = totalEngagedUsers + self.totalChats = totalChats + self.totalChatInsertionEvents = totalChatInsertionEvents + self.totalChatCopyEvents = totalChatCopyEvents + } + public enum CodingKeys: String, CodingKey { + case name + case isCustomModel = "is_custom_model" + case customModelTrainingDate = "custom_model_training_date" + case totalEngagedUsers = "total_engaged_users" + case totalChats = "total_chats" + case totalChatInsertionEvents = "total_chat_insertion_events" + case totalChatCopyEvents = "total_chat_copy_events" + } + } + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. + public typealias ModelsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayloadPayload] + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. + public var models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? + /// Creates a new `EditorsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the given editor. + /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the specified editor. + /// - models: List of model metrics for custom models and the default model. + public init( + name: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? = nil + ) { + self.name = name + self.totalEngagedUsers = totalEngagedUsers + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case totalEngagedUsers = "total_engaged_users" + case models + } + } + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public typealias EditorsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public var editors: Components.Schemas.CopilotIdeChat.EditorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotIdeChat`. + /// + /// - Parameters: + /// - totalEngagedUsers: Total number of users who prompted Copilot Chat in the IDE. + /// - editors: + /// - additionalProperties: A container of undocumented properties. + public init( + totalEngagedUsers: Swift.Int? = nil, + editors: Components.Schemas.CopilotIdeChat.EditorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.totalEngagedUsers = totalEngagedUsers + self.editors = editors + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case totalEngagedUsers = "total_engaged_users" + case editors + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.editors = try container.decodeIfPresent( + Components.Schemas.CopilotIdeChat.EditorsPayload.self, + forKey: .editors + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "editors" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.editors, + forKey: .editors + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Usage metrics for Copilot Chat in GitHub.com + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat`. + public struct CopilotDotcomChat: Codable, Hashable, Sendable { + /// Total number of users who prompted Copilot Chat on github.com at least once. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload`. + public struct ModelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/is_custom_model`. + public var isCustomModel: Swift.Bool? + /// The training date for the custom model (if applicable). + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/custom_model_training_date`. + public var customModelTrainingDate: Swift.String? + /// Total number of users who prompted Copilot Chat on github.com at least once for each model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Total number of chats initiated by users on github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_chats`. + public var totalChats: Swift.Int? + /// Creates a new `ModelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. + /// - isCustomModel: Indicates whether a model is custom or default. + /// - customModelTrainingDate: The training date for the custom model (if applicable). + /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once for each model. + /// - totalChats: Total number of chats initiated by users on github.com. + public init( + name: Swift.String? = nil, + isCustomModel: Swift.Bool? = nil, + customModelTrainingDate: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + totalChats: Swift.Int? = nil + ) { + self.name = name + self.isCustomModel = isCustomModel + self.customModelTrainingDate = customModelTrainingDate + self.totalEngagedUsers = totalEngagedUsers + self.totalChats = totalChats + } + public enum CodingKeys: String, CodingKey { + case name + case isCustomModel = "is_custom_model" + case customModelTrainingDate = "custom_model_training_date" + case totalEngagedUsers = "total_engaged_users" + case totalChats = "total_chats" + } + } + /// List of model metrics for a custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public typealias ModelsPayload = [Components.Schemas.CopilotDotcomChat.ModelsPayloadPayload] + /// List of model metrics for a custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public var models: Components.Schemas.CopilotDotcomChat.ModelsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotDotcomChat`. + /// + /// - Parameters: + /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once. + /// - models: List of model metrics for a custom models and the default model. + /// - additionalProperties: A container of undocumented properties. + public init( + totalEngagedUsers: Swift.Int? = nil, + models: Components.Schemas.CopilotDotcomChat.ModelsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.totalEngagedUsers = totalEngagedUsers + self.models = models + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case totalEngagedUsers = "total_engaged_users" + case models + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.models = try container.decodeIfPresent( + Components.Schemas.CopilotDotcomChat.ModelsPayload.self, + forKey: .models + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "models" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.models, + forKey: .models + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Usage metrics for Copilot for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests`. + public struct CopilotDotcomPullRequests: Codable, Hashable, Sendable { + /// The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload`. + public struct RepositoriesPayloadPayload: Codable, Hashable, Sendable { + /// Repository name + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/name`. + public var name: Swift.String? + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload`. + public struct ModelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/is_custom_model`. + public var isCustomModel: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/custom_model_training_date`. + public var customModelTrainingDate: Swift.String? + /// The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_pr_summaries_created`. + public var totalPrSummariesCreated: Swift.Int? + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// Creates a new `ModelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. + /// - isCustomModel: Indicates whether a model is custom or default. + /// - customModelTrainingDate: The training date for the custom model. + /// - totalPrSummariesCreated: The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. public init( name: Swift.String? = nil, isCustomModel: Swift.Bool? = nil, customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalChats: Swift.Int? = nil, - totalChatInsertionEvents: Swift.Int? = nil, - totalChatCopyEvents: Swift.Int? = nil + totalPrSummariesCreated: Swift.Int? = nil, + totalEngagedUsers: Swift.Int? = nil ) { self.name = name self.isCustomModel = isCustomModel self.customModelTrainingDate = customModelTrainingDate + self.totalPrSummariesCreated = totalPrSummariesCreated self.totalEngagedUsers = totalEngagedUsers - self.totalChats = totalChats - self.totalChatInsertionEvents = totalChatInsertionEvents - self.totalChatCopyEvents = totalChatCopyEvents } public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case totalChats = "total_chats" - case totalChatInsertionEvents = "total_chat_insertion_events" - case totalChatCopyEvents = "total_chat_copy_events" + case name + case isCustomModel = "is_custom_model" + case customModelTrainingDate = "custom_model_training_date" + case totalPrSummariesCreated = "total_pr_summaries_created" + case totalEngagedUsers = "total_engaged_users" + } + } + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. + public typealias ModelsPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayloadPayload] + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. + public var models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? + /// Creates a new `RepositoriesPayloadPayload`. + /// + /// - Parameters: + /// - name: Repository name + /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. + /// - models: List of model metrics for custom models and the default model. + public init( + name: Swift.String? = nil, + totalEngagedUsers: Swift.Int? = nil, + models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? = nil + ) { + self.name = name + self.totalEngagedUsers = totalEngagedUsers + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case totalEngagedUsers = "total_engaged_users" + case models + } + } + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public typealias RepositoriesPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload] + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public var repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotDotcomPullRequests`. + /// + /// - Parameters: + /// - totalEngagedUsers: The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + /// - repositories: Repositories in which users used Copilot for Pull Requests to generate pull request summaries + /// - additionalProperties: A container of undocumented properties. + public init( + totalEngagedUsers: Swift.Int? = nil, + repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.totalEngagedUsers = totalEngagedUsers + self.repositories = repositories + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case totalEngagedUsers = "total_engaged_users" + case repositories + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.repositories = try container.decodeIfPresent( + Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload.self, + forKey: .repositories + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "repositories" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.repositories, + forKey: .repositories + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Copilot usage metrics for a given day. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day`. + public struct CopilotUsageMetricsDay: Codable, Hashable, Sendable { + /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/date`. + public var date: Swift.String + /// The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_active_users`. + public var totalActiveUsers: Swift.Int? + /// The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_engaged_users`. + public var totalEngagedUsers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_code_completions`. + public var copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_chat`. + public var copilotIdeChat: Components.Schemas.CopilotIdeChat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_chat`. + public var copilotDotcomChat: Components.Schemas.CopilotDotcomChat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_pull_requests`. + public var copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CopilotUsageMetricsDay`. + /// + /// - Parameters: + /// - date: The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. + /// - totalActiveUsers: The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// - totalEngagedUsers: The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// - copilotIdeCodeCompletions: + /// - copilotIdeChat: + /// - copilotDotcomChat: + /// - copilotDotcomPullRequests: + /// - additionalProperties: A container of undocumented properties. + public init( + date: Swift.String, + totalActiveUsers: Swift.Int? = nil, + totalEngagedUsers: Swift.Int? = nil, + copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? = nil, + copilotIdeChat: Components.Schemas.CopilotIdeChat? = nil, + copilotDotcomChat: Components.Schemas.CopilotDotcomChat? = nil, + copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.date = date + self.totalActiveUsers = totalActiveUsers + self.totalEngagedUsers = totalEngagedUsers + self.copilotIdeCodeCompletions = copilotIdeCodeCompletions + self.copilotIdeChat = copilotIdeChat + self.copilotDotcomChat = copilotDotcomChat + self.copilotDotcomPullRequests = copilotDotcomPullRequests + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case date + case totalActiveUsers = "total_active_users" + case totalEngagedUsers = "total_engaged_users" + case copilotIdeCodeCompletions = "copilot_ide_code_completions" + case copilotIdeChat = "copilot_ide_chat" + case copilotDotcomChat = "copilot_dotcom_chat" + case copilotDotcomPullRequests = "copilot_dotcom_pull_requests" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.date = try container.decode( + Swift.String.self, + forKey: .date + ) + self.totalActiveUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalActiveUsers + ) + self.totalEngagedUsers = try container.decodeIfPresent( + Swift.Int.self, + forKey: .totalEngagedUsers + ) + self.copilotIdeCodeCompletions = try container.decodeIfPresent( + Components.Schemas.CopilotIdeCodeCompletions.self, + forKey: .copilotIdeCodeCompletions + ) + self.copilotIdeChat = try container.decodeIfPresent( + Components.Schemas.CopilotIdeChat.self, + forKey: .copilotIdeChat + ) + self.copilotDotcomChat = try container.decodeIfPresent( + Components.Schemas.CopilotDotcomChat.self, + forKey: .copilotDotcomChat + ) + self.copilotDotcomPullRequests = try container.decodeIfPresent( + Components.Schemas.CopilotDotcomPullRequests.self, + forKey: .copilotDotcomPullRequests + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "date", + "total_active_users", + "total_engaged_users", + "copilot_ide_code_completions", + "copilot_ide_chat", + "copilot_dotcom_chat", + "copilot_dotcom_pull_requests" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.date, + forKey: .date + ) + try container.encodeIfPresent( + self.totalActiveUsers, + forKey: .totalActiveUsers + ) + try container.encodeIfPresent( + self.totalEngagedUsers, + forKey: .totalEngagedUsers + ) + try container.encodeIfPresent( + self.copilotIdeCodeCompletions, + forKey: .copilotIdeCodeCompletions + ) + try container.encodeIfPresent( + self.copilotIdeChat, + forKey: .copilotIdeChat + ) + try container.encodeIfPresent( + self.copilotDotcomChat, + forKey: .copilotDotcomChat + ) + try container.encodeIfPresent( + self.copilotDotcomPullRequests, + forKey: .copilotDotcomPullRequests + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct InternalError: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.InternalError.Body + /// Creates a new `InternalError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.InternalError.Body) { + self.body = body + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Conflict.Body) { + self.body = body + } + } + public struct TooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/too_large/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/too_large/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.TooLarge.Body + /// Creates a new `TooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.TooLarge.Body) { + self.body = body + } + } + public struct UsageMetricsApiDisabled: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.UsageMetricsApiDisabled.Body + /// Creates a new `UsageMetricsApiDisabled`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.UsageMetricsApiDisabled.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// Get Copilot seat information and settings for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about an organization's Copilot subscription, including seat breakdown + /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." + /// + /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. + public enum CopilotGetCopilotOrganizationDetails { + public static let id: Swift.String = "copilot/get-copilot-organization-details" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CopilotGetCopilotOrganizationDetails.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path, + headers: Operations.CopilotGetCopilotOrganizationDetails.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}/copilot/billing/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotOrganizationDetails) + /// 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.CopilotOrganizationDetails { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotGetCopilotOrganizationDetails.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.CopilotGetCopilotOrganizationDetails.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/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 UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// There is a problem with your account's associated payment method. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent) + /// There is a problem with your account's associated payment method. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List all Copilot seat assignments for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. + /// Only organization owners can view assigned seats. + /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. + public enum CopilotListCopilotSeats { + public static let id: Swift.String = "copilot/list-copilot-seats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotListCopilotSeats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query/per_page`. + public var perPage: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Swift.Int? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.CopilotListCopilotSeats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CopilotListCopilotSeats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.CopilotListCopilotSeats.Input.Path, + query: Operations.CopilotListCopilotSeats.Input.Query = .init(), + headers: Operations.CopilotListCopilotSeats.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Total number of Copilot seats for the organization currently being billed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. + public var totalSeats: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/seats`. + public var seats: [Components.Schemas.CopilotSeatDetails]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalSeats: Total number of Copilot seats for the organization currently being billed. + /// - seats: + public init( + totalSeats: Swift.Int? = nil, + seats: [Components.Schemas.CopilotSeatDetails]? = nil + ) { + self.totalSeats = totalSeats + self.seats = seats + } + public enum CodingKeys: String, CodingKey { + case totalSeats = "total_seats" + case seats + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/application\/json`. + case json(Operations.CopilotListCopilotSeats.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.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotListCopilotSeats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers = .init(), + body: Operations.CopilotListCopilotSeats.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotListCopilotSeats.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.CopilotListCopilotSeats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add teams to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. + public enum CopilotAddCopilotSeatsForTeams { + public static let id: Swift.String = "copilot/add-copilot-seats-for-teams" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of team names within the organization to which to grant access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json/selected_teams`. + public var selectedTeams: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedTeams: List of team names within the organization to which to grant access to GitHub Copilot. + public init(selectedTeams: [Swift.String]) { + self.selectedTeams = selectedTeams + } + public enum CodingKeys: String, CodingKey { + case selectedTeams = "selected_teams" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForTeams.Input.Body.JsonPayload) + } + public var body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path, + headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers = .init(), + body: Operations.CopilotAddCopilotSeatsForTeams.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}/copilot/billing/selected_teams/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats created for members of the specified team(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json/seats_created`. + public var seatsCreated: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCreated: + public init(seatsCreated: Swift.Int) { + self.seatsCreated = seatsCreated + } + public enum CodingKeys: String, CodingKey { + case seatsCreated = "seats_created" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.CopilotAddCopilotSeatsForTeams.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CopilotAddCopilotSeatsForTeams.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/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 UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove teams from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response contains the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. + public enum CopilotCancelCopilotSeatAssignmentForTeams { + public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-teams" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The names of teams from which to revoke access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json/selected_teams`. + public var selectedTeams: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedTeams: The names of teams from which to revoke access to GitHub Copilot. + public init(selectedTeams: [Swift.String]) { + self.selectedTeams = selectedTeams + } + public enum CodingKeys: String, CodingKey { + case selectedTeams = "selected_teams" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body.JsonPayload) + } + public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path, + headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers = .init(), + body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.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}/copilot/billing/selected_teams/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats set to "pending cancellation" for members of the specified team(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json/seats_cancelled`. + public var seatsCancelled: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCancelled: + public init(seatsCancelled: Swift.Int) { + self.seatsCancelled = seatsCancelled + } + public enum CodingKeys: String, CodingKey { + case seatsCancelled = "seats_cancelled" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCancelCopilotSeatAssignmentForTeams.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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/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 UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add users to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. + public enum CopilotAddCopilotSeatsForUsers { + public static let id: Swift.String = "copilot/add-copilot-seats-for-users" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The usernames of the organization members to be granted access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json/selected_usernames`. + public var selectedUsernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedUsernames: The usernames of the organization members to be granted access to GitHub Copilot. + public init(selectedUsernames: [Swift.String]) { + self.selectedUsernames = selectedUsernames + } + public enum CodingKeys: String, CodingKey { + case selectedUsernames = "selected_usernames" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForUsers.Input.Body.JsonPayload) + } + public var body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path, + headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers = .init(), + body: Operations.CopilotAddCopilotSeatsForUsers.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}/copilot/billing/selected_users/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats created for the specified user(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json/seats_created`. + public var seatsCreated: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCreated: + public init(seatsCreated: Swift.Int) { + self.seatsCreated = seatsCreated + } + public enum CodingKeys: String, CodingKey { + case seatsCreated = "seats_created" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.CopilotAddCopilotSeatsForUsers.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CopilotAddCopilotSeatsForUsers.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/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 UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) } } - /// List of model metrics for custom models and the default model. + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove users from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response contains the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. + public enum CopilotCancelCopilotSeatAssignmentForUsers { + public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-users" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. - public var models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? - /// Creates a new `EditorsPayloadPayload`. + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// /// - Parameters: - /// - name: Name of the given editor. - /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the specified editor. - /// - models: List of model metrics for custom models and the default model. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models + } + public var headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The usernames of the organization members for which to revoke access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json/selected_usernames`. + public var selectedUsernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedUsernames: The usernames of the organization members for which to revoke access to GitHub Copilot. + public init(selectedUsernames: [Swift.String]) { + self.selectedUsernames = selectedUsernames + } + public enum CodingKeys: String, CodingKey { + case selectedUsernames = "selected_usernames" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body.JsonPayload) } - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. - public typealias EditorsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. - public var editors: Components.Schemas.CopilotIdeChat.EditorsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotIdeChat`. + public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body + /// Creates a new `Input`. /// /// - Parameters: - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat in the IDE. - /// - editors: - /// - additionalProperties: A container of undocumented properties. + /// - path: + /// - headers: + /// - body: public init( - totalEngagedUsers: Swift.Int? = nil, - editors: Components.Schemas.CopilotIdeChat.EditorsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path, + headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers = .init(), + body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body ) { - self.totalEngagedUsers = totalEngagedUsers - self.editors = editors - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case editors - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.editors = try container.decodeIfPresent( - Components.Schemas.CopilotIdeChat.EditorsPayload.self, - forKey: .editors - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "editors" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.editors, - forKey: .editors - ) - try encoder.encodeAdditionalProperties(additionalProperties) + self.path = path + self.headers = headers + self.body = body } } - /// Usage metrics for Copilot Chat in GitHub.com - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat`. - public struct CopilotDotcomChat: Codable, Hashable, Sendable { - /// Total number of users who prompted Copilot Chat on github.com at least once. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model (if applicable). - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// Total number of users who prompted Copilot Chat on github.com at least once for each model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Total number of chats initiated by users on github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_chats`. - public var totalChats: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model (if applicable). - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once for each model. - /// - totalChats: Total number of chats initiated by users on github.com. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalChats: Swift.Int? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalEngagedUsers = totalEngagedUsers - self.totalChats = totalChats + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats set to "pending cancellation" for the specified users. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json/seats_cancelled`. + public var seatsCancelled: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCancelled: + public init(seatsCancelled: Swift.Int) { + self.seatsCancelled = seatsCancelled + } + public enum CodingKeys: String, CodingKey { + case seatsCancelled = "seats_cancelled" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case totalChats = "total_chats" + /// Received HTTP response body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body) { + self.body = body } } - /// List of model metrics for a custom models and the default model. + /// OK /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotDotcomChat.ModelsPayloadPayload] - /// List of model metrics for a custom models and the default model. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/200`. /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. - public var models: Components.Schemas.CopilotDotcomChat.ModelsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotDotcomChat`. + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Parameters: - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once. - /// - models: List of model metrics for a custom models and the default model. - /// - additionalProperties: A container of undocumented properties. - public init( - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotDotcomChat.ModelsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.totalEngagedUsers = totalEngagedUsers - self.models = models - self.additionalProperties = additionalProperties + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case models + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.models = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomChat.ModelsPayload.self, - forKey: .models - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "models" - ]) + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.models, - forKey: .models - ) - try encoder.encodeAdditionalProperties(additionalProperties) + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - } - /// Usage metrics for Copilot for pull requests. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests`. - public struct CopilotDotcomPullRequests: Codable, Hashable, Sendable { - /// The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + /// Resource not found /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload`. - public struct RepositoriesPayloadPayload: Codable, Hashable, Sendable { - /// Repository name - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/name`. - public var name: Swift.String? - /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// The number of pull request summaries generated using Copilot for Pull Requests in the given repository. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_pr_summaries_created`. - public var totalPrSummariesCreated: Swift.Int? - /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalPrSummariesCreated: The number of pull request summaries generated using Copilot for Pull Requests in the given repository. - /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalPrSummariesCreated: Swift.Int? = nil, - totalEngagedUsers: Swift.Int? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalPrSummariesCreated = totalPrSummariesCreated - self.totalEngagedUsers = totalEngagedUsers + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.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 enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalPrSummariesCreated = "total_pr_summaries_created" - case totalEngagedUsers = "total_engaged_users" + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) } } - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + public enum CopilotGetCopilotCodingAgentPermissionsOrganization { + public static let id: Swift.String = "copilot/get-copilot-coding-agent-permissions-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. - public var models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? - /// Creates a new `RepositoriesPayloadPayload`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. /// /// - Parameters: - /// - name: Repository name - /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. - /// - models: List of model metrics for custom models and the default model. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models + } + public var path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/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 } } - /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. - public typealias RepositoriesPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload] - /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. - public var repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotDotcomPullRequests`. + public var headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - totalEngagedUsers: The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. - /// - repositories: Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - additionalProperties: A container of undocumented properties. + /// - path: + /// - headers: public init( - totalEngagedUsers: Swift.Int? = nil, - repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init() ) { - self.totalEngagedUsers = totalEngagedUsers - self.repositories = repositories - self.additionalProperties = additionalProperties + self.path = path + self.headers = headers } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case repositories + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. + public var enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.EnabledRepositoriesPayload + /// The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// - selectedRepositoriesUrl: The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. + public init( + enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.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 `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/application\/json`. + case json(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body) { + self.body = body + } } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.repositories = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload.self, - forKey: .repositories - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "repositories" - ]) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.repositories, - forKey: .repositories - ) - try encoder.encodeAdditionalProperties(additionalProperties) + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-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 + ) + } + } } - } - /// Copilot usage metrics for a given day. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day`. - public struct CopilotUsageMetricsDay: Codable, Hashable, Sendable { - /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/date`. - public var date: Swift.String - /// The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// Resource not found /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_active_users`. - public var totalActiveUsers: Swift.Int? - /// The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/404`. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_code_completions`. - public var copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_chat`. - public var copilotIdeChat: Components.Schemas.CopilotIdeChat? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_chat`. - public var copilotDotcomChat: Components.Schemas.CopilotDotcomChat? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_pull_requests`. - public var copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotUsageMetricsDay`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Parameters: - /// - date: The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. - /// - totalActiveUsers: The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - totalEngagedUsers: The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - copilotIdeCodeCompletions: - /// - copilotIdeChat: - /// - copilotDotcomChat: - /// - copilotDotcomPullRequests: - /// - additionalProperties: A container of undocumented properties. - public init( - date: Swift.String, - totalActiveUsers: Swift.Int? = nil, - totalEngagedUsers: Swift.Int? = nil, - copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? = nil, - copilotIdeChat: Components.Schemas.CopilotIdeChat? = nil, - copilotDotcomChat: Components.Schemas.CopilotDotcomChat? = nil, - copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.date = date - self.totalActiveUsers = totalActiveUsers - self.totalEngagedUsers = totalEngagedUsers - self.copilotIdeCodeCompletions = copilotIdeCodeCompletions - self.copilotIdeChat = copilotIdeChat - self.copilotDotcomChat = copilotDotcomChat - self.copilotDotcomPullRequests = copilotDotcomPullRequests - self.additionalProperties = additionalProperties + /// - 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 enum CodingKeys: String, CodingKey { - case date - case totalActiveUsers = "total_active_users" - case totalEngagedUsers = "total_engaged_users" - case copilotIdeCodeCompletions = "copilot_ide_code_completions" - case copilotIdeChat = "copilot_ide_chat" - case copilotDotcomChat = "copilot_dotcom_chat" - case copilotDotcomPullRequests = "copilot_dotcom_pull_requests" + /// 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 init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.date = try container.decode( - Swift.String.self, - forKey: .date - ) - self.totalActiveUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalActiveUsers - ) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.copilotIdeCodeCompletions = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.self, - forKey: .copilotIdeCodeCompletions - ) - self.copilotIdeChat = try container.decodeIfPresent( - Components.Schemas.CopilotIdeChat.self, - forKey: .copilotIdeChat - ) - self.copilotDotcomChat = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomChat.self, - forKey: .copilotDotcomChat - ) - self.copilotDotcomPullRequests = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomPullRequests.self, - forKey: .copilotDotcomPullRequests - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "date", - "total_active_users", - "total_engaged_users", - "copilot_ide_code_completions", - "copilot_ide_chat", - "copilot_dotcom_chat", - "copilot_dotcom_pull_requests" - ]) + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - self.date, - forKey: .date - ) - try container.encodeIfPresent( - self.totalActiveUsers, - forKey: .totalActiveUsers - ) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.copilotIdeCodeCompletions, - forKey: .copilotIdeCodeCompletions - ) - try container.encodeIfPresent( - self.copilotIdeChat, - forKey: .copilotIdeChat - ) - try container.encodeIfPresent( - self.copilotDotcomChat, - forKey: .copilotDotcomChat - ) - try container.encodeIfPresent( - self.copilotDotcomPullRequests, - forKey: .copilotDotcomPullRequests - ) - try encoder.encodeAdditionalProperties(additionalProperties) + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// Set Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + public enum CopilotSetCopilotCodingAgentPermissionsOrganization { + public static let id: Swift.String = "copilot/set-copilot-coding-agent-permissions-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/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.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/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 for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + public init(enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload) { + self.enabledRepositories = enabledRepositories + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" } } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload) } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + public var body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + ) { + self.path = path + self.headers = headers self.body = body } } - public struct RequiresAuthentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + @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}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output.NoContent) + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-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.CopilotSetCopilotCodingAgentPermissionsOrganization.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: Components.Responses.RequiresAuthentication.Body - /// Creates a new `RequiresAuthentication`. + /// Internal Error /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.RequiresAuthentication.Body) { - self.body = body - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. + /// Requires authentication /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } } - } - public struct InternalError: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.InternalError.Body - /// Creates a new `InternalError`. + /// Resource not found /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.InternalError.Body) { - self.body = body + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-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 struct UsageMetricsApiDisabled: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.UsageMetricsApiDisabled.Body - /// Creates a new `UsageMetricsApiDisabled`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.UsageMetricsApiDisabled.Body) { - self.body = body + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias Link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// Get Copilot seat information and settings for an organization + /// List repositories enabled for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Gets information about an organization's Copilot subscription, including seat breakdown - /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. /// - /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes 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}/copilot/billing`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. - public enum CopilotGetCopilotOrganizationDetails { - public static let id: Swift.String = "copilot/get-copilot-organization-details" + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + public enum CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization { + public static let id: Swift.String = "copilot/list-copilot-coding-agent-selected-repositories-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -2653,43 +6829,93 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/header`. + public var path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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}/copilot/coding-agent/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}/copilot/coding-agent/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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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.CopilotGetCopilotOrganizationDetails.Input.Headers + public var headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path, - headers: Operations.CopilotGetCopilotOrganizationDetails.Input.Headers = .init() + path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + query: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query = .init(), + headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CopilotOrganizationDetails) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/application\/json`. + case json(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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.CopilotOrganizationDetails { + public var json: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -2699,26 +6925,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body + public var body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body) { + public init(body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body) { self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotGetCopilotOrganizationDetails.Output.Ok) + case ok(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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.CopilotGetCopilotOrganizationDetails.Output.Ok { + public var ok: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -2733,7 +6959,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -2756,7 +6982,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -2779,7 +7005,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -2802,7 +7028,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -2823,36 +7049,24 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// There is a problem with your account's associated payment method. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent) - /// There is a problem with your account's associated payment method. + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/409`. /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .unprocessableContent(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "conflict", response: self ) } @@ -2889,29 +7103,27 @@ public enum Operations { } } } - /// List all Copilot seat assignments for an organization + /// Set selected repositories for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. - /// Only organization owners can view assigned seats. - /// - /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes 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}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. - public enum CopilotListCopilotSeats { - public static let id: Swift.String = "copilot/list-copilot-seats" + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + public enum CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization { + public static let id: Swift.String = "copilot/set-copilot-coding-agent-selected-repositories-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -2921,150 +7133,89 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotListCopilotSeats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/query/per_page`. - public var perPage: Swift.Int? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - page: Components.Parameters.Page? = nil, - perPage: Swift.Int? = nil - ) { - self.page = page - self.perPage = perPage - } - } - public var query: Operations.CopilotListCopilotSeats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/header`. + public var path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CopilotListCopilotSeats.Input.Headers + public var headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs to enable for Copilot coding agent. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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 Copilot coding agent. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body.JsonPayload) + } + public var body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.CopilotListCopilotSeats.Input.Path, - query: Operations.CopilotListCopilotSeats.Input.Query = .init(), - headers: Operations.CopilotListCopilotSeats.Input.Headers = .init() + path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.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}/copilot/billing/seats/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Total number of Copilot seats for the organization currently being billed. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. - public var totalSeats: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/seats`. - public var seats: [Components.Schemas.CopilotSeatDetails]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalSeats: Total number of Copilot seats for the organization currently being billed. - /// - seats: - public init( - totalSeats: Swift.Int? = nil, - seats: [Components.Schemas.CopilotSeatDetails]? = nil - ) { - self.totalSeats = totalSeats - self.seats = seats - } - public enum CodingKeys: String, CodingKey { - case totalSeats = "total_seats" - case seats - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/application\/json`. - case json(Operations.CopilotListCopilotSeats.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.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CopilotListCopilotSeats.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers = .init(), - body: Operations.CopilotListCopilotSeats.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// No Content /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.CopilotListCopilotSeats.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output.NoContent) + /// No Content /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CopilotListCopilotSeats.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-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.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.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 ) } @@ -3072,7 +7223,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -3095,7 +7246,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -3118,7 +7269,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -3141,7 +7292,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3156,7 +7307,53 @@ public enum Operations { return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-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}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-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 ) } @@ -3193,157 +7390,102 @@ public enum Operations { } } } - /// Add teams to the Copilot subscription for an organization + /// Enable a repository for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." - /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." - /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. - public enum CopilotAddCopilotSeatsForTeams { - public static let id: Swift.String = "copilot/add-copilot-seats-for-teams" + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + public enum CopilotEnableCopilotCodingAgentForRepositoryInOrganization { + public static let id: Swift.String = "copilot/enable-copilot-coding-agent-for-repository-in-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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}/copilot/billing/selected_teams/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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}/copilot/coding-agent/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. - 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.CopilotAddCopilotSeatsForTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/header`. + public var path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of team names within the organization to which to grant access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json/selected_teams`. - public var selectedTeams: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedTeams: List of team names within the organization to which to grant access to GitHub Copilot. - public init(selectedTeams: [Swift.String]) { - self.selectedTeams = selectedTeams - } - public enum CodingKeys: String, CodingKey { - case selectedTeams = "selected_teams" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForTeams.Input.Body.JsonPayload) - } - public var body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body + public var headers: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path, - headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers = .init(), - body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body + path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.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}/copilot/billing/selected_teams/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// The total number of seats created for members of the specified team(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json/seats_created`. - public var seatsCreated: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCreated: - public init(seatsCreated: Swift.Int) { - self.seatsCreated = seatsCreated - } - public enum CodingKeys: String, CodingKey { - case seatsCreated = "seats_created" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// OK + /// No Content /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Operations.CopilotAddCopilotSeatsForTeams.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) + /// No Content /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.CopilotAddCopilotSeatsForTeams.Output.Created { + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-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.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent { get throws { switch self { - case let .created(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "noContent", response: self ) } @@ -3351,7 +7493,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -3374,7 +7516,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -3397,7 +7539,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -3420,7 +7562,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3441,29 +7583,40 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/409`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. + /// - 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}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } + 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: Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent { + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { case let .unprocessableContent(response): @@ -3507,156 +7660,102 @@ public enum Operations { } } } - /// Remove teams from the Copilot subscription for an organization + /// Disable a repository for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets seats for all members of each team specified to "pending cancellation". - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." - /// - /// Only organization owners can cancel Copilot seats for their organization members. - /// - /// The response contains the total number of seats set to "pending cancellation". + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. - public enum CopilotCancelCopilotSeatAssignmentForTeams { - public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-teams" + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + public enum CopilotDisableCopilotCodingAgentForRepositoryInOrganization { + public static let id: Swift.String = "copilot/disable-copilot-coding-agent-for-repository-in-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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}/copilot/billing/selected_teams/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/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}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - 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.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/header`. + public var path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of teams from which to revoke access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json/selected_teams`. - public var selectedTeams: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedTeams: The names of teams from which to revoke access to GitHub Copilot. - public init(selectedTeams: [Swift.String]) { - self.selectedTeams = selectedTeams - } - public enum CodingKeys: String, CodingKey { - case selectedTeams = "selected_teams" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body.JsonPayload) - } - public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body + public var headers: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path, - headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers = .init(), - body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body + path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.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}/copilot/billing/selected_teams/DELETE/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// The total number of seats set to "pending cancellation" for members of the specified team(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json/seats_cancelled`. - public var seatsCancelled: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCancelled: - public init(seatsCancelled: Swift.Int) { - self.seatsCancelled = seatsCancelled - } - public enum CodingKeys: String, CodingKey { - case seatsCancelled = "seats_cancelled" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// OK + /// No Content /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) + /// No Content /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-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.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.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 ) } @@ -3664,7 +7763,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -3687,7 +7786,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -3710,7 +7809,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -3733,7 +7832,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3754,36 +7853,24 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/409`. /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .unprocessableContent(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "conflict", response: self ) } @@ -3820,32 +7907,33 @@ public enum Operations { } } } - /// Add users to the Copilot subscription for an organization + /// Get Copilot content exclusion rules for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// Organization owners can view details about Copilot content exclusion rules for the organization. /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. - public enum CopilotAddCopilotSeatsForUsers { - public static let id: Swift.String = "copilot/add-copilot-seats-for-users" + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + public enum CopilotCopilotContentExclusionForOrganization { + public static let id: Swift.String = "copilot/copilot-content-exclusion-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -3855,86 +7943,43 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/header`. + public var path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/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.CopilotAddCopilotSeatsForUsers.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members to be granted access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json/selected_usernames`. - public var selectedUsernames: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedUsernames: The usernames of the organization members to be granted access to GitHub Copilot. - public init(selectedUsernames: [Swift.String]) { - self.selectedUsernames = selectedUsernames - } - public enum CodingKeys: String, CodingKey { - case selectedUsernames = "selected_usernames" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForUsers.Input.Body.JsonPayload) - } - public var body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body + public var headers: Operations.CopilotCopilotContentExclusionForOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path, - headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers = .init(), - body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body + path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotCopilotContentExclusionForOrganization.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}/copilot/billing/selected_users/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seats created for the specified user(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json/seats_created`. - public var seatsCreated: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCreated: - public init(seatsCreated: Swift.Int) { - self.seatsCreated = seatsCreated - } - public enum CodingKeys: String, CodingKey { - case seatsCreated = "seats_created" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotOrganizationContentExclusionDetails) /// 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.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload { + public var json: Components.Schemas.CopilotOrganizationContentExclusionDetails { get throws { switch self { case let .json(body): @@ -3944,33 +7989,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body) { + public init(body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body) { self.body = body } } /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.CopilotAddCopilotSeatsForUsers.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotContentExclusionForOrganization.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.CopilotAddCopilotSeatsForUsers.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotCopilotContentExclusionForOrganization.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 ) } @@ -3978,7 +8023,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -4001,7 +8046,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -4024,7 +8069,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4047,7 +8092,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -4068,41 +8113,6 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -4134,31 +8144,33 @@ public enum Operations { } } } - /// Remove users from the Copilot subscription for an organization + /// Set Copilot content exclusion rules for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets seats for all users specified to "pending cancellation". - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// Organization owners can set Copilot content exclusion rules for the organization. /// - /// The response contains the total number of seats set to "pending cancellation". + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. - public enum CopilotCancelCopilotSeatAssignmentForUsers { - public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-users" + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + public enum CopilotSetCopilotContentExclusionForOrganization { + public static let id: Swift.String = "copilot/set-copilot-content-exclusion-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -4168,42 +8180,156 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/header`. + public var path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/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.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody`. + public var headers: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members for which to revoke access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json/selected_usernames`. - public var selectedUsernames: [Swift.String] + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The path to the file that will be excluded. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2/ifAnyMatch`. + public var ifAnyMatch: [Swift.String] + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - ifAnyMatch: + public init(ifAnyMatch: [Swift.String]) { + self.ifAnyMatch = ifAnyMatch + } + public enum CodingKeys: String, CodingKey { + case ifAnyMatch + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.ifAnyMatch = try container.decode( + [Swift.String].self, + forKey: .ifAnyMatch + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "ifAnyMatch" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. + public var value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. + public struct Value3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3/ifNoneMatch`. + public var ifNoneMatch: [Swift.String] + /// Creates a new `Value3Payload`. + /// + /// - Parameters: + /// - ifNoneMatch: + public init(ifNoneMatch: [Swift.String]) { + self.ifNoneMatch = ifNoneMatch + } + public enum CodingKeys: String, CodingKey { + case ifNoneMatch + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.ifNoneMatch = try container.decode( + [Swift.String].self, + forKey: .ifNoneMatch + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "ifNoneMatch" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. + public var value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value3Payload? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - value1: The path to the file that will be excluded. + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? = nil, + value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value3Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1 + ]) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayload] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedUsernames: The usernames of the organization members for which to revoke access to GitHub Copilot. - public init(selectedUsernames: [Swift.String]) { - self.selectedUsernames = selectedUsernames + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayload] = .init()) { + self.additionalProperties = additionalProperties } - public enum CodingKeys: String, CodingKey { - case selectedUsernames = "selected_usernames" + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload) } - public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body + public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -4211,9 +8337,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path, - headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers = .init(), - body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body + path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body ) { self.path = path self.headers = headers @@ -4222,32 +8348,30 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seats set to "pending cancellation" for the specified users. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json/seats_cancelled`. - public var seatsCancelled: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json/message`. + public var message: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - seatsCancelled: - public init(seatsCancelled: Swift.Int) { - self.seatsCancelled = seatsCancelled + /// - message: + public init(message: Swift.String? = nil) { + self.message = message } public enum CodingKeys: String, CodingKey { - case seatsCancelled = "seats_cancelled" + case message } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/application\/json`. + case json(Operations.CopilotSetCopilotContentExclusionForOrganization.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload { + public var json: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -4257,26 +8381,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body) { + public init(body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body) { self.body = body } } - /// OK + /// Success /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok) + case ok(Operations.CopilotSetCopilotContentExclusionForOrganization.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok { + public var ok: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -4291,7 +8415,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -4314,7 +8438,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -4337,7 +8461,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4360,7 +8484,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -4381,29 +8505,40 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// Payload Too Large /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/413`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Components.Responses.TooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Components.Responses.TooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } + case unprocessableContent(Components.Responses.ValidationFailedSimple) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent { + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { case let .unprocessableContent(response): @@ -4670,7 +8805,7 @@ public enum Operations { } } } - /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// Copilot Usage Metrics API setting is disabled at the organization or enterprise level. /// /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. /// @@ -5234,7 +9369,7 @@ public enum Operations { } } } - /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// Copilot Usage Metrics API setting is disabled at the organization or enterprise level. /// /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/422`. /// From 38ed3a1cae37b1fb983c363a05e6685e03ff0ec4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:16:31 +0000 Subject: [PATCH 27/33] Commit via running: make Sources/security-advisories --- Sources/security-advisories/Types.swift | 262 +++++++++++++++++++++--- 1 file changed, 232 insertions(+), 30 deletions(-) diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index 40b470ef71..59455adb58 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -1016,7 +1016,7 @@ public enum Components { case cwes case credits } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.ghsaId = try container.decode( Swift.String.self, @@ -1282,8 +1282,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -1308,7 +1308,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1781,6 +1781,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2026,6 +2045,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2123,6 +2145,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2220,6 +2245,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2318,6 +2346,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2899,6 +2930,107 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: @@ -2909,6 +3041,9 @@ public enum Components { /// - secretScanningPushProtection: /// - secretScanningNonProviderPatterns: /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: public init( advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, @@ -2916,7 +3051,10 @@ public enum Components { secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, - secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil ) { self.advancedSecurity = advancedSecurity self.codeSecurity = codeSecurity @@ -2925,6 +3063,9 @@ public enum Components { self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions } public enum CodingKeys: String, CodingKey { case advancedSecurity = "advanced_security" @@ -2934,6 +3075,9 @@ public enum Components { case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3451,6 +3595,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -3696,6 +3859,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -3793,6 +3959,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -3890,6 +4059,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3988,6 +4160,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4193,6 +4368,21 @@ public enum Components { public var hasDownloads: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/has_discussions`. public var hasDiscussions: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -4389,10 +4579,10 @@ public enum Components { public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { self.additionalProperties = additionalProperties } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -4470,6 +4660,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4574,6 +4767,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool? = nil, hasDiscussions: Swift.Bool, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4678,6 +4874,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4783,6 +4982,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4892,7 +5094,7 @@ public enum Components { case patchedVersions = "patched_versions" case vulnerableFunctions = "vulnerable_functions" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.package = try container.decodeIfPresent( Components.Schemas.RepositoryAdvisoryVulnerability.PackagePayload.self, @@ -4958,7 +5160,7 @@ public enum Components { case _type = "type" case state } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.user = try container.decode( Components.Schemas.SimpleUser.self, @@ -5033,10 +5235,10 @@ public enum Components { public init(value1: Components.Schemas.SimpleUser) { self.value1 = value1 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) } } @@ -5057,10 +5259,10 @@ public enum Components { public init(value1: Components.Schemas.SimpleUser) { self.value1 = value1 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) } } @@ -5279,10 +5481,10 @@ public enum Components { public init(value1: Components.Schemas.SimpleRepository) { self.value1 = value1 } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { self.value1 = try .init(from: decoder) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1.encode(to: encoder) } } @@ -5406,7 +5608,7 @@ public enum Components { case collaboratingTeams = "collaborating_teams" case privateFork = "private_fork" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.ghsaId = try container.decode( Swift.String.self, @@ -5630,7 +5832,7 @@ public enum Components { case patchedVersions = "patched_versions" case vulnerableFunctions = "vulnerable_functions" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.package = try container.decode( Components.Schemas.RepositoryAdvisoryCreate.VulnerabilitiesPayloadPayload.PackagePayload.self, @@ -5692,7 +5894,7 @@ public enum Components { case login case _type = "type" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.login = try container.decode( Swift.String.self, @@ -5781,7 +5983,7 @@ public enum Components { case cvssVectorString = "cvss_vector_string" case startPrivateFork = "start_private_fork" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.summary = try container.decode( Swift.String.self, @@ -5911,7 +6113,7 @@ public enum Components { case patchedVersions = "patched_versions" case vulnerableFunctions = "vulnerable_functions" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.package = try container.decode( Components.Schemas.PrivateVulnerabilityReportCreate.VulnerabilitiesPayloadPayload.PackagePayload.self, @@ -6006,7 +6208,7 @@ public enum Components { case cvssVectorString = "cvss_vector_string" case startPrivateFork = "start_private_fork" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.summary = try container.decode( Swift.String.self, @@ -6130,7 +6332,7 @@ public enum Components { case patchedVersions = "patched_versions" case vulnerableFunctions = "vulnerable_functions" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.package = try container.decode( Components.Schemas.RepositoryAdvisoryUpdate.VulnerabilitiesPayloadPayload.PackagePayload.self, @@ -6192,7 +6394,7 @@ public enum Components { case login case _type = "type" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.login = try container.decode( Swift.String.self, @@ -6305,7 +6507,7 @@ public enum Components { case collaboratingUsers = "collaborating_users" case collaboratingTeams = "collaborating_teams" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.summary = try container.decodeIfPresent( Swift.String.self, @@ -6657,8 +6859,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/advisories/GET/query/cwes/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -6677,7 +6879,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -6702,8 +6904,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/advisories/GET/query/affects/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -6722,7 +6924,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) From 770ce07dff9226b84b7a9626d4c15ce6df0d5968 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:16:53 +0000 Subject: [PATCH 28/33] Commit via running: make Sources/interactions --- Sources/interactions/Types.swift | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Sources/interactions/Types.swift b/Sources/interactions/Types.swift index db325da164..7e6d0783f5 100644 --- a/Sources/interactions/Types.swift +++ b/Sources/interactions/Types.swift @@ -246,8 +246,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -272,7 +272,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -533,7 +533,7 @@ public enum Operations { public struct Value2Payload: Codable, Hashable, Sendable { /// Creates a new `Value2Payload`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -551,8 +551,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -573,7 +573,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -965,7 +965,7 @@ public enum Operations { public struct Value2Payload: Codable, Hashable, Sendable { /// Creates a new `Value2Payload`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -983,8 +983,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -1005,7 +1005,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } @@ -1433,7 +1433,7 @@ public enum Operations { public struct Value2Payload: Codable, Hashable, Sendable { /// Creates a new `Value2Payload`. public init() {} - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } @@ -1451,8 +1451,8 @@ public enum Operations { self.value1 = value1 self.value2 = value2 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try .init(from: decoder) } catch { @@ -1473,7 +1473,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try self.value1?.encode(to: encoder) try self.value2?.encode(to: encoder) } From 41cc3c1439a8a43451abe57df92d6c8d1100ebb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:19:06 +0000 Subject: [PATCH 29/33] Commit via running: make Sources/code-security --- Sources/code-security/Types.swift | 204 ++++++++++++++++++++++++++++-- 1 file changed, 196 insertions(+), 8 deletions(-) diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index 11922d7b0f..82e988572c 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -1035,6 +1035,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. public var dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? + /// The enablement status of Dependabot delegated alert dismissal + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_delegated_alert_dismissal`. + @frozen public enum DependabotDelegatedAlertDismissalPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of Dependabot delegated alert dismissal + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_delegated_alert_dismissal`. + public var dependabotDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.DependabotDelegatedAlertDismissalPayload? /// Feature options for code scanning /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. @@ -1180,21 +1192,29 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. public var reviewerType: Components.Schemas.CodeSecurityConfiguration.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// The ID of the security configuration associated with this bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/ReviewersPayload/security_configuration_id`. + public var securityConfigurationId: Swift.Int? /// Creates a new `ReviewersPayloadPayload`. /// /// - Parameters: /// - reviewerId: The ID of the team or role selected as a bypass reviewer /// - reviewerType: The type of the bypass reviewer + /// - securityConfigurationId: The ID of the security configuration associated with this bypass reviewer public init( reviewerId: Swift.Int, - reviewerType: Components.Schemas.CodeSecurityConfiguration.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + reviewerType: Components.Schemas.CodeSecurityConfiguration.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload, + securityConfigurationId: Swift.Int? = nil ) { self.reviewerId = reviewerId self.reviewerType = reviewerType + self.securityConfigurationId = securityConfigurationId } public enum CodingKeys: String, CodingKey { case reviewerId = "reviewer_id" case reviewerType = "reviewer_type" + case securityConfigurationId = "security_configuration_id" } } /// The bypass reviewers for secret scanning delegated bypass @@ -1268,6 +1288,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_alert_dismissal`. public var secretScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.SecretScanningDelegatedAlertDismissalPayload? + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_extended_metadata`. + @frozen public enum SecretScanningExtendedMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_extended_metadata`. + public var secretScanningExtendedMetadata: Components.Schemas.CodeSecurityConfiguration.SecretScanningExtendedMetadataPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. @@ -1316,6 +1348,7 @@ public enum Components { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - dependabotDelegatedAlertDismissal: The enablement status of Dependabot delegated alert dismissal /// - codeScanningOptions: Feature options for code scanning /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: Feature options for code scanning default setup @@ -1328,6 +1361,7 @@ public enum Components { /// - secretScanningNonProviderPatterns: The enablement status of secret scanning non-provider patterns /// - secretScanningGenericSecrets: The enablement status of Copilot secret scanning /// - secretScanningDelegatedAlertDismissal: The enablement status of secret scanning delegated alert dismissal + /// - secretScanningExtendedMetadata: The enablement status of secret scanning extended metadata /// - privateVulnerabilityReporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration /// - url: The URL of the configuration @@ -1345,6 +1379,7 @@ public enum Components { dependencyGraphAutosubmitActionOptions: Components.Schemas.CodeSecurityConfiguration.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Components.Schemas.CodeSecurityConfiguration.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? = nil, + dependabotDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.DependabotDelegatedAlertDismissalPayload? = nil, codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? = nil, codeScanningDefaultSetup: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupOptionsPayload? = nil, @@ -1357,6 +1392,7 @@ public enum Components { secretScanningNonProviderPatterns: Components.Schemas.CodeSecurityConfiguration.SecretScanningNonProviderPatternsPayload? = nil, secretScanningGenericSecrets: Components.Schemas.CodeSecurityConfiguration.SecretScanningGenericSecretsPayload? = nil, secretScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningExtendedMetadata: Components.Schemas.CodeSecurityConfiguration.SecretScanningExtendedMetadataPayload? = nil, privateVulnerabilityReporting: Components.Schemas.CodeSecurityConfiguration.PrivateVulnerabilityReportingPayload? = nil, enforcement: Components.Schemas.CodeSecurityConfiguration.EnforcementPayload? = nil, url: Swift.String? = nil, @@ -1374,6 +1410,7 @@ public enum Components { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.dependabotDelegatedAlertDismissal = dependabotDelegatedAlertDismissal self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions @@ -1386,6 +1423,7 @@ public enum Components { self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningGenericSecrets = secretScanningGenericSecrets self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningExtendedMetadata = secretScanningExtendedMetadata self.privateVulnerabilityReporting = privateVulnerabilityReporting self.enforcement = enforcement self.url = url @@ -1404,6 +1442,7 @@ public enum Components { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case dependabotDelegatedAlertDismissal = "dependabot_delegated_alert_dismissal" case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" @@ -1416,6 +1455,7 @@ public enum Components { case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningGenericSecrets = "secret_scanning_generic_secrets" case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningExtendedMetadata = "secret_scanning_extended_metadata" case privateVulnerabilityReporting = "private_vulnerability_reporting" case enforcement case url @@ -2667,6 +2707,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. public var secretScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_extended_metadata`. + @frozen public enum SecretScanningExtendedMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_extended_metadata`. + public var secretScanningExtendedMetadata: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. @@ -2713,6 +2765,7 @@ public enum Operations { /// - secretScanningNonProviderPatterns: The enablement status of secret scanning non provider patterns /// - secretScanningGenericSecrets: The enablement status of Copilot secret scanning /// - secretScanningDelegatedAlertDismissal: The enablement status of secret scanning delegated alert dismissal + /// - secretScanningExtendedMetadata: The enablement status of secret scanning extended metadata /// - privateVulnerabilityReporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -2736,6 +2789,7 @@ public enum Operations { secretScanningNonProviderPatterns: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningNonProviderPatternsPayload? = nil, secretScanningGenericSecrets: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningGenericSecretsPayload? = nil, secretScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningExtendedMetadata: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? = nil, privateVulnerabilityReporting: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload? = nil, enforcement: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.EnforcementPayload? = nil ) { @@ -2759,6 +2813,7 @@ public enum Operations { self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningGenericSecrets = secretScanningGenericSecrets self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningExtendedMetadata = secretScanningExtendedMetadata self.privateVulnerabilityReporting = privateVulnerabilityReporting self.enforcement = enforcement } @@ -2783,10 +2838,11 @@ public enum Operations { case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningGenericSecrets = "secret_scanning_generic_secrets" case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningExtendedMetadata = "secret_scanning_extended_metadata" case privateVulnerabilityReporting = "private_vulnerability_reporting" case enforcement } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decode( Swift.String.self, @@ -2868,6 +2924,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload.self, forKey: .secretScanningDelegatedAlertDismissal ) + self.secretScanningExtendedMetadata = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload.self, + forKey: .secretScanningExtendedMetadata + ) self.privateVulnerabilityReporting = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload.self, forKey: .privateVulnerabilityReporting @@ -2897,6 +2957,7 @@ public enum Operations { "secret_scanning_non_provider_patterns", "secret_scanning_generic_secrets", "secret_scanning_delegated_alert_dismissal", + "secret_scanning_extended_metadata", "private_vulnerability_reporting", "enforcement" ]) @@ -3617,6 +3678,8 @@ public enum Operations { public var codeScanningDefaultSetup: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup_options`. public var codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning delegated alert dismissal /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. @@ -3713,6 +3776,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. public var secretScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_extended_metadata`. + @frozen public enum SecretScanningExtendedMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_extended_metadata`. + public var secretScanningExtendedMetadata: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. @@ -3750,6 +3825,7 @@ public enum Operations { /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: + /// - codeScanningOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning @@ -3758,6 +3834,7 @@ public enum Operations { /// - secretScanningNonProviderPatterns: The enablement status of secret scanning non-provider patterns /// - secretScanningGenericSecrets: The enablement status of Copilot secret scanning /// - secretScanningDelegatedAlertDismissal: The enablement status of secret scanning delegated alert dismissal + /// - secretScanningExtendedMetadata: The enablement status of secret scanning extended metadata /// - privateVulnerabilityReporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -3772,6 +3849,7 @@ public enum Operations { dependabotSecurityUpdates: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, codeScanningDefaultSetup: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, secretProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, @@ -3780,6 +3858,7 @@ public enum Operations { secretScanningNonProviderPatterns: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningNonProviderPatternsPayload? = nil, secretScanningGenericSecrets: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningGenericSecretsPayload? = nil, secretScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningExtendedMetadata: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? = nil, privateVulnerabilityReporting: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload? = nil, enforcement: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.EnforcementPayload? = nil ) { @@ -3794,6 +3873,7 @@ public enum Operations { self.dependabotSecurityUpdates = dependabotSecurityUpdates self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions + self.codeScanningOptions = codeScanningOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal self.secretProtection = secretProtection self.secretScanning = secretScanning @@ -3802,6 +3882,7 @@ public enum Operations { self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningGenericSecrets = secretScanningGenericSecrets self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningExtendedMetadata = secretScanningExtendedMetadata self.privateVulnerabilityReporting = privateVulnerabilityReporting self.enforcement = enforcement } @@ -3817,6 +3898,7 @@ public enum Operations { case dependabotSecurityUpdates = "dependabot_security_updates" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" + case codeScanningOptions = "code_scanning_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" case secretProtection = "secret_protection" case secretScanning = "secret_scanning" @@ -3825,10 +3907,11 @@ public enum Operations { case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningGenericSecrets = "secret_scanning_generic_secrets" case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningExtendedMetadata = "secret_scanning_extended_metadata" case privateVulnerabilityReporting = "private_vulnerability_reporting" case enforcement } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decodeIfPresent( Swift.String.self, @@ -3874,6 +3957,10 @@ public enum Operations { Components.Schemas.CodeScanningDefaultSetupOptions.self, forKey: .codeScanningDefaultSetupOptions ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDelegatedAlertDismissal = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal @@ -3906,6 +3993,10 @@ public enum Operations { Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload.self, forKey: .secretScanningDelegatedAlertDismissal ) + self.secretScanningExtendedMetadata = try container.decodeIfPresent( + Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload.self, + forKey: .secretScanningExtendedMetadata + ) self.privateVulnerabilityReporting = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload.self, forKey: .privateVulnerabilityReporting @@ -3926,6 +4017,7 @@ public enum Operations { "dependabot_security_updates", "code_scanning_default_setup", "code_scanning_default_setup_options", + "code_scanning_options", "code_scanning_delegated_alert_dismissal", "secret_protection", "secret_scanning", @@ -3934,6 +4026,7 @@ public enum Operations { "secret_scanning_non_provider_patterns", "secret_scanning_generic_secrets", "secret_scanning_delegated_alert_dismissal", + "secret_scanning_extended_metadata", "private_vulnerability_reporting", "enforcement" ]) @@ -4443,7 +4536,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case scope } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.scope = try container.decode( Operations.CodeSecurityAttachEnterpriseConfiguration.Input.Body.JsonPayload.ScopePayload.self, @@ -5478,6 +5571,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_delegated_alert_dismissal`. + @frozen public enum DependabotDelegatedAlertDismissalPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_delegated_alert_dismissal`. + public var dependabotDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload? /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_options`. public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup @@ -5663,6 +5768,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. public var secretScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_extended_metadata`. + @frozen public enum SecretScanningExtendedMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_extended_metadata`. + public var secretScanningExtendedMetadata: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. @@ -5698,6 +5815,7 @@ public enum Operations { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - dependabotDelegatedAlertDismissal: The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: @@ -5711,6 +5829,7 @@ public enum Operations { /// - secretScanningNonProviderPatterns: The enablement status of secret scanning non provider patterns /// - secretScanningGenericSecrets: The enablement status of Copilot secret scanning /// - secretScanningDelegatedAlertDismissal: The enablement status of secret scanning delegated alert dismissal + /// - secretScanningExtendedMetadata: The enablement status of secret scanning extended metadata /// - privateVulnerabilityReporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -5723,6 +5842,7 @@ public enum Operations { dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + dependabotDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload? = nil, codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, @@ -5736,6 +5856,7 @@ public enum Operations { secretScanningNonProviderPatterns: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningNonProviderPatternsPayload? = nil, secretScanningGenericSecrets: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningGenericSecretsPayload? = nil, secretScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningExtendedMetadata: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? = nil, privateVulnerabilityReporting: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload? = nil, enforcement: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.EnforcementPayload? = nil ) { @@ -5748,6 +5869,7 @@ public enum Operations { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.dependabotDelegatedAlertDismissal = dependabotDelegatedAlertDismissal self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions @@ -5761,6 +5883,7 @@ public enum Operations { self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningGenericSecrets = secretScanningGenericSecrets self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningExtendedMetadata = secretScanningExtendedMetadata self.privateVulnerabilityReporting = privateVulnerabilityReporting self.enforcement = enforcement } @@ -5774,6 +5897,7 @@ public enum Operations { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case dependabotDelegatedAlertDismissal = "dependabot_delegated_alert_dismissal" case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" @@ -5787,10 +5911,11 @@ public enum Operations { case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningGenericSecrets = "secret_scanning_generic_secrets" case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningExtendedMetadata = "secret_scanning_extended_metadata" case privateVulnerabilityReporting = "private_vulnerability_reporting" case enforcement } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decode( Swift.String.self, @@ -5828,6 +5953,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.dependabotDelegatedAlertDismissal = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload.self, + forKey: .dependabotDelegatedAlertDismissal + ) self.codeScanningOptions = try container.decodeIfPresent( Components.Schemas.CodeScanningOptions.self, forKey: .codeScanningOptions @@ -5880,6 +6009,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload.self, forKey: .secretScanningDelegatedAlertDismissal ) + self.secretScanningExtendedMetadata = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload.self, + forKey: .secretScanningExtendedMetadata + ) self.privateVulnerabilityReporting = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload.self, forKey: .privateVulnerabilityReporting @@ -5898,6 +6031,7 @@ public enum Operations { "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "dependabot_delegated_alert_dismissal", "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", @@ -5911,6 +6045,7 @@ public enum Operations { "secret_scanning_non_provider_patterns", "secret_scanning_generic_secrets", "secret_scanning_delegated_alert_dismissal", + "secret_scanning_extended_metadata", "private_vulnerability_reporting", "enforcement" ]) @@ -6291,7 +6426,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case selectedRepositoryIds = "selected_repository_ids" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.selectedRepositoryIds = try container.decodeIfPresent( [Swift.Int].self, @@ -6870,6 +7005,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_delegated_alert_dismissal`. + @frozen public enum DependabotDelegatedAlertDismissalPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_delegated_alert_dismissal`. + public var dependabotDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup`. @@ -6884,6 +7031,8 @@ public enum Operations { public var codeScanningDefaultSetup: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup_options`. public var codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning delegated alert dismissal /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. @@ -7053,6 +7202,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. public var secretScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_extended_metadata`. + @frozen public enum SecretScanningExtendedMetadataPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of secret scanning extended metadata + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_extended_metadata`. + public var secretScanningExtendedMetadata: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. @@ -7088,8 +7249,10 @@ public enum Operations { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - dependabotDelegatedAlertDismissal: The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled. /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: + /// - codeScanningOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning @@ -7100,6 +7263,7 @@ public enum Operations { /// - secretScanningNonProviderPatterns: The enablement status of secret scanning non-provider patterns /// - secretScanningGenericSecrets: The enablement status of Copilot secret scanning /// - secretScanningDelegatedAlertDismissal: The enablement status of secret scanning delegated alert dismissal + /// - secretScanningExtendedMetadata: The enablement status of secret scanning extended metadata /// - privateVulnerabilityReporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -7112,8 +7276,10 @@ public enum Operations { dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + dependabotDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload? = nil, codeScanningDefaultSetup: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, secretProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, @@ -7124,6 +7290,7 @@ public enum Operations { secretScanningNonProviderPatterns: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningNonProviderPatternsPayload? = nil, secretScanningGenericSecrets: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningGenericSecretsPayload? = nil, secretScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningExtendedMetadata: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload? = nil, privateVulnerabilityReporting: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload? = nil, enforcement: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.EnforcementPayload? = nil ) { @@ -7136,8 +7303,10 @@ public enum Operations { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.dependabotDelegatedAlertDismissal = dependabotDelegatedAlertDismissal self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions + self.codeScanningOptions = codeScanningOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal self.secretProtection = secretProtection self.secretScanning = secretScanning @@ -7148,6 +7317,7 @@ public enum Operations { self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns self.secretScanningGenericSecrets = secretScanningGenericSecrets self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningExtendedMetadata = secretScanningExtendedMetadata self.privateVulnerabilityReporting = privateVulnerabilityReporting self.enforcement = enforcement } @@ -7161,8 +7331,10 @@ public enum Operations { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case dependabotDelegatedAlertDismissal = "dependabot_delegated_alert_dismissal" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" + case codeScanningOptions = "code_scanning_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" case secretProtection = "secret_protection" case secretScanning = "secret_scanning" @@ -7173,10 +7345,11 @@ public enum Operations { case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" case secretScanningGenericSecrets = "secret_scanning_generic_secrets" case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningExtendedMetadata = "secret_scanning_extended_metadata" case privateVulnerabilityReporting = "private_vulnerability_reporting" case enforcement } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decodeIfPresent( Swift.String.self, @@ -7214,6 +7387,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.dependabotDelegatedAlertDismissal = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependabotDelegatedAlertDismissalPayload.self, + forKey: .dependabotDelegatedAlertDismissal + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -7222,6 +7399,10 @@ public enum Operations { Components.Schemas.CodeScanningDefaultSetupOptions.self, forKey: .codeScanningDefaultSetupOptions ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDelegatedAlertDismissal = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal @@ -7262,6 +7443,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedAlertDismissalPayload.self, forKey: .secretScanningDelegatedAlertDismissal ) + self.secretScanningExtendedMetadata = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningExtendedMetadataPayload.self, + forKey: .secretScanningExtendedMetadata + ) self.privateVulnerabilityReporting = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.PrivateVulnerabilityReportingPayload.self, forKey: .privateVulnerabilityReporting @@ -7280,8 +7465,10 @@ public enum Operations { "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "dependabot_delegated_alert_dismissal", "code_scanning_default_setup", "code_scanning_default_setup_options", + "code_scanning_options", "code_scanning_delegated_alert_dismissal", "secret_protection", "secret_scanning", @@ -7292,6 +7479,7 @@ public enum Operations { "secret_scanning_non_provider_patterns", "secret_scanning_generic_secrets", "secret_scanning_delegated_alert_dismissal", + "secret_scanning_extended_metadata", "private_vulnerability_reporting", "enforcement" ]) @@ -7749,7 +7937,7 @@ public enum Operations { case scope case selectedRepositoryIds = "selected_repository_ids" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.scope = try container.decode( Operations.CodeSecurityAttachConfiguration.Input.Body.JsonPayload.ScopePayload.self, From b79e0d49f7172bb93ef04cae991477aa4148828c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:19:28 +0000 Subject: [PATCH 30/33] Commit via running: make Sources/private-registries --- Sources/private-registries/Types.swift | 54 ++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 48220a69a0..2d86bd09b8 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -330,8 +330,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -356,7 +356,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -459,10 +459,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/registry_type`. public var registryType: Components.Schemas.OrgPrivateRegistryConfiguration.RegistryTypePayload + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/url`. + public var url: Swift.String? /// The username to use when authenticating with the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/username`. public var username: Swift.String? + /// Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/replaces_base`. + public var replacesBase: Swift.Bool? /// Which type of organization repositories have access to the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/visibility`. @@ -484,21 +492,27 @@ public enum Components { /// - Parameters: /// - name: The name of the private registry configuration. /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. + /// - replacesBase: Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - visibility: Which type of organization repositories have access to the private registry. /// - createdAt: /// - updatedAt: public init( name: Swift.String, registryType: Components.Schemas.OrgPrivateRegistryConfiguration.RegistryTypePayload, + url: Swift.String? = nil, username: Swift.String? = nil, + replacesBase: Swift.Bool? = nil, visibility: Components.Schemas.OrgPrivateRegistryConfiguration.VisibilityPayload, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { self.name = name self.registryType = registryType + self.url = url self.username = username + self.replacesBase = replacesBase self.visibility = visibility self.createdAt = createdAt self.updatedAt = updatedAt @@ -506,7 +520,9 @@ public enum Components { public enum CodingKeys: String, CodingKey { case name case registryType = "registry_type" + case url case username + case replacesBase = "replaces_base" case visibility case createdAt = "created_at" case updatedAt = "updated_at" @@ -544,10 +560,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/registry_type`. public var registryType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.RegistryTypePayload + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/url`. + public var url: Swift.String? /// The username to use when authenticating with the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/username`. public var username: Swift.String? + /// Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/replaces_base`. + public var replacesBase: Swift.Bool? /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/visibility`. @@ -573,7 +597,9 @@ public enum Components { /// - Parameters: /// - name: The name of the private registry configuration. /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. + /// - replacesBase: Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. /// - createdAt: @@ -581,7 +607,9 @@ public enum Components { public init( name: Swift.String, registryType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.RegistryTypePayload, + url: Swift.String? = nil, username: Swift.String? = nil, + replacesBase: Swift.Bool? = nil, visibility: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.VisibilityPayload, selectedRepositoryIds: [Swift.Int]? = nil, createdAt: Foundation.Date, @@ -589,7 +617,9 @@ public enum Components { ) { self.name = name self.registryType = registryType + self.url = url self.username = username + self.replacesBase = replacesBase self.visibility = visibility self.selectedRepositoryIds = selectedRepositoryIds self.createdAt = createdAt @@ -598,7 +628,9 @@ public enum Components { public enum CodingKeys: String, CodingKey { case name case registryType = "registry_type" + case url case username + case replacesBase = "replaces_base" case visibility case selectedRepositoryIds = "selected_repository_ids" case createdAt = "created_at" @@ -1079,6 +1111,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/username`. public var username: Swift.String? + /// Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/replaces_base`. + public var replacesBase: Swift.Bool? /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/encrypted_value`. @@ -1109,6 +1145,7 @@ public enum Operations { /// - registryType: The registry type. /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// - replacesBase: Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. @@ -1117,6 +1154,7 @@ public enum Operations { registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, url: Swift.String, username: Swift.String? = nil, + replacesBase: Swift.Bool? = nil, encryptedValue: Swift.String, keyId: Swift.String, visibility: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.VisibilityPayload, @@ -1125,6 +1163,7 @@ public enum Operations { self.registryType = registryType self.url = url self.username = username + self.replacesBase = replacesBase self.encryptedValue = encryptedValue self.keyId = keyId self.visibility = visibility @@ -1134,6 +1173,7 @@ public enum Operations { case registryType = "registry_type" case url case username + case replacesBase = "replaces_base" case encryptedValue = "encrypted_value" case keyId = "key_id" case visibility @@ -1744,6 +1784,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/username`. public var username: Swift.String? + /// Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/replaces_base`. + public var replacesBase: Swift.Bool? /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/encrypted_value`. @@ -1774,6 +1818,7 @@ public enum Operations { /// - registryType: The registry type. /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// - replacesBase: Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. @@ -1782,6 +1827,7 @@ public enum Operations { registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, url: Swift.String? = nil, username: Swift.String? = nil, + replacesBase: Swift.Bool? = nil, encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, visibility: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.VisibilityPayload? = nil, @@ -1790,6 +1836,7 @@ public enum Operations { self.registryType = registryType self.url = url self.username = username + self.replacesBase = replacesBase self.encryptedValue = encryptedValue self.keyId = keyId self.visibility = visibility @@ -1799,6 +1846,7 @@ public enum Operations { case registryType = "registry_type" case url case username + case replacesBase = "replaces_base" case encryptedValue = "encrypted_value" case keyId = "key_id" case visibility From a36b3adaceccd8d34093cd8d0b145c41df679b3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:19:51 +0000 Subject: [PATCH 31/33] Commit via running: make Sources/hosted-compute --- Sources/hosted-compute/Types.swift | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Sources/hosted-compute/Types.swift b/Sources/hosted-compute/Types.swift index 0ee225d62f..4707941ecf 100644 --- a/Sources/hosted-compute/Types.swift +++ b/Sources/hosted-compute/Types.swift @@ -224,6 +224,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/network-configuration/network_settings_ids`. public var networkSettingsIds: [Swift.String]? + /// The unique identifier of each failover network settings in the configuration. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/failover_network_settings_ids`. + public var failoverNetworkSettingsIds: [Swift.String]? + /// Indicates whether the failover network resource is enabled. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/failover_network_enabled`. + public var failoverNetworkEnabled: Swift.Bool? /// The time at which the network configuration was created, in ISO 8601 format. /// /// - Remark: Generated from `#/components/schemas/network-configuration/created_on`. @@ -235,18 +243,24 @@ public enum Components { /// - name: The name of the network configuration. /// - computeService: The hosted compute service the network configuration supports. /// - networkSettingsIds: The unique identifier of each network settings in the configuration. + /// - failoverNetworkSettingsIds: The unique identifier of each failover network settings in the configuration. + /// - failoverNetworkEnabled: Indicates whether the failover network resource is enabled. /// - createdOn: The time at which the network configuration was created, in ISO 8601 format. public init( id: Swift.String, name: Swift.String, computeService: Components.Schemas.NetworkConfiguration.ComputeServicePayload? = nil, networkSettingsIds: [Swift.String]? = nil, + failoverNetworkSettingsIds: [Swift.String]? = nil, + failoverNetworkEnabled: Swift.Bool? = nil, createdOn: Foundation.Date? = nil ) { self.id = id self.name = name self.computeService = computeService self.networkSettingsIds = networkSettingsIds + self.failoverNetworkSettingsIds = failoverNetworkSettingsIds + self.failoverNetworkEnabled = failoverNetworkEnabled self.createdOn = createdOn } public enum CodingKeys: String, CodingKey { @@ -254,6 +268,8 @@ public enum Components { case name case computeService = "compute_service" case networkSettingsIds = "network_settings_ids" + case failoverNetworkSettingsIds = "failover_network_settings_ids" + case failoverNetworkEnabled = "failover_network_enabled" case createdOn = "created_on" } } @@ -607,7 +623,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/compute_service`. public var computeService: Operations.HostedComputeCreateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? - /// The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/network_settings_ids`. public var networkSettingsIds: [Swift.String] @@ -616,7 +632,7 @@ public enum Operations { /// - Parameters: /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. /// - computeService: The hosted compute service to use for the network configuration. - /// - networkSettingsIds: The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// - networkSettingsIds: A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. public init( name: Swift.String, computeService: Operations.HostedComputeCreateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? = nil, @@ -963,7 +979,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/compute_service`. public var computeService: Operations.HostedComputeUpdateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? - /// The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/network_settings_ids`. public var networkSettingsIds: [Swift.String]? @@ -972,7 +988,7 @@ public enum Operations { /// - Parameters: /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. /// - computeService: The hosted compute service to use for the network configuration. - /// - networkSettingsIds: The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// - networkSettingsIds: A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. public init( name: Swift.String? = nil, computeService: Operations.HostedComputeUpdateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? = nil, From a10b807de071d3e9fbc44786e4358371c17b676a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:20:35 +0000 Subject: [PATCH 32/33] Commit via running: make Sources/campaigns --- Sources/campaigns/Types.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/campaigns/Types.swift b/Sources/campaigns/Types.swift index ef5004dacf..2a6511c8cd 100644 --- a/Sources/campaigns/Types.swift +++ b/Sources/campaigns/Types.swift @@ -782,7 +782,7 @@ public enum Components { case closedCount = "closed_count" case inProgressCount = "in_progress_count" } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.openCount = try container.decode( Swift.Int.self, @@ -1310,8 +1310,8 @@ public enum Operations { } /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/case2`. case case2(Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try .init(from: decoder)) return @@ -1330,7 +1330,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try value.encode(to: encoder) @@ -1982,7 +1982,7 @@ public enum Operations { case contactLink = "contact_link" case state } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decodeIfPresent( Swift.String.self, From 9fb12f65ab6df00cf87d16a1a5404c6b116adf2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:20:58 +0000 Subject: [PATCH 33/33] Commit via running: make Sources/projects --- Sources/projects/Client.swift | 1350 +++++- Sources/projects/Types.swift | 8362 ++++++++++++++++++++++++--------- 2 files changed, 7340 insertions(+), 2372 deletions(-) diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index fb63d96127..913d379ab7 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -303,6 +303,126 @@ public struct Client: APIProtocol { } ) } + /// Create draft item for organization owned project + /// + /// Create draft issue item for the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)`. + public func projectsCreateDraftItemForOrg(_ input: Operations.ProjectsCreateDraftItemForOrg.Input) async throws -> Operations.ProjectsCreateDraftItemForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsCreateDraftItemForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/drafts", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateDraftItemForOrg.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.ProjectsV2ItemSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List project fields for organization /// /// List all fields for a specific organization-owned project. @@ -443,6 +563,148 @@ public struct Client: APIProtocol { } ) } + /// Add a field to an organization-owned project. + /// + /// Add a field to an organization-owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)`. + public func projectsAddFieldForOrg(_ input: Operations.ProjectsAddFieldForOrg.Input) async throws -> Operations.ProjectsAddFieldForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsAddFieldForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/fields", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsAddFieldForOrg.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.ProjectsV2Field.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get project field for organization /// /// Get a specific field for an organization-owned project. @@ -1217,22 +1479,684 @@ public struct Client: APIProtocol { } ) } - /// List projects for user + /// Create a view for an organization-owned project /// - /// List all projects owned by a specific user accessible by the authenticated user. + /// Create a new view in an organization-owned project. Views allow you to customize how items in a project are displayed and filtered. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)`. + public func projectsCreateViewForOrg(_ input: Operations.ProjectsCreateViewForOrg.Input) async throws -> Operations.ProjectsCreateViewForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListForUser.id, + forOperation: Operations.ProjectsCreateViewForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/users/{}/projectsV2", + template: "/orgs/{}/projectsV2/{}/views", parameters: [ - input.path.username - ] + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateViewForOrg.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.ProjectsV2View.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateViewForOrg.Output.ServiceUnavailable.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 .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List items for an organization project view + /// + /// List items in an organization project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)`. + public func projectsListViewItemsForOrg(_ input: Operations.ProjectsListViewItemsForOrg.Input) async throws -> Operations.ProjectsListViewItemsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListViewItemsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/views/{}/items", + parameters: [ + input.path.org, + input.path.projectNumber, + input.path.viewNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListViewItemsForOrg.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.ProjectsListViewItemsForOrg.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.ProjectsV2ItemWithContent].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create draft item for user owned project + /// + /// Create draft issue item for the specified user owned project. + /// + /// - Remark: HTTP `POST /user/{user_id}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)`. + public func projectsCreateDraftItemForAuthenticatedUser(_ input: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsCreateDraftItemForAuthenticatedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/user/{}/projectsV2/{}/drafts", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.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.ProjectsV2ItemSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a view for a user-owned project + /// + /// Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)`. + public func projectsCreateViewForUser(_ input: Operations.ProjectsCreateViewForUser.Input) async throws -> Operations.ProjectsCreateViewForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsCreateViewForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/views", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateViewForUser.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.ProjectsV2View.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsCreateViewForUser.Output.ServiceUnavailable.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 .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2", + parameters: [ + input.path.username + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, @@ -1381,11 +2305,151 @@ public struct Client: APIProtocol { input.path.projectNumber ] ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetForUser.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.ProjectsGetForUser.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.ProjectsV2.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListFieldsForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/fields", + parameters: [ + input.path.username, + input.path.projectNumber + ] + ) + 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: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after ) - suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1395,13 +2459,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ProjectsListFieldsForUser.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.ProjectsGetForUser.Output.Ok.Body + let body: Operations.ProjectsListFieldsForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1411,7 +2475,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectsV2.self, + [Components.Schemas.ProjectsV2Field].self, from: responseBody, transforming: { value in .json(value) @@ -1482,16 +2546,16 @@ public struct Client: APIProtocol { } ) } - /// List project fields for user + /// Add field to user owned project /// - /// List all fields for a specific user-owned project. + /// Add a field to a specified user owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. - public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)`. + public func projectsAddFieldForUser(_ input: Operations.ProjectsAddFieldForUser.Input) async throws -> Operations.ProjectsAddFieldForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListFieldsForUser.id, + forOperation: Operations.ProjectsAddFieldForUser.id, serializer: { input in let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/fields", @@ -1502,46 +2566,29 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) 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: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "after", - value: input.query.after - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + 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.ProjectsListFieldsForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + let body: Operations.ProjectsAddFieldForUser.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1551,7 +2598,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.ProjectsV2Field].self, + Components.Schemas.ProjectsV2Field.self, from: responseBody, transforming: { value in .json(value) @@ -1560,10 +2607,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .created(.init(body: body)) case 304: return .notModified(.init()) case 403: @@ -1610,6 +2654,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.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, @@ -2396,4 +3462,174 @@ public struct Client: APIProtocol { } ) } + /// List items for a user project view + /// + /// List items in a user project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)`. + public func projectsListViewItemsForUser(_ input: Operations.ProjectsListViewItemsForUser.Input) async throws -> Operations.ProjectsListViewItemsForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListViewItemsForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/views/{}/items", + parameters: [ + input.path.username, + input.path.projectNumber, + input.path.viewNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListViewItemsForUser.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.ProjectsListViewItemsForUser.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.ProjectsV2ItemWithContent].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index ea34381e5b..137c9079d6 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -25,6 +25,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. func projectsGetForOrg(_ input: Operations.ProjectsGetForOrg.Input) async throws -> Operations.ProjectsGetForOrg.Output + /// Create draft item for organization owned project + /// + /// Create draft issue item for the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)`. + func projectsCreateDraftItemForOrg(_ input: Operations.ProjectsCreateDraftItemForOrg.Input) async throws -> Operations.ProjectsCreateDraftItemForOrg.Output /// List project fields for organization /// /// List all fields for a specific organization-owned project. @@ -32,6 +39,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. func projectsListFieldsForOrg(_ input: Operations.ProjectsListFieldsForOrg.Input) async throws -> Operations.ProjectsListFieldsForOrg.Output + /// Add a field to an organization-owned project. + /// + /// Add a field to an organization-owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)`. + func projectsAddFieldForOrg(_ input: Operations.ProjectsAddFieldForOrg.Input) async throws -> Operations.ProjectsAddFieldForOrg.Output /// Get project field for organization /// /// Get a specific field for an organization-owned project. @@ -74,6 +88,34 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output + /// Create a view for an organization-owned project + /// + /// Create a new view in an organization-owned project. Views allow you to customize how items in a project are displayed and filtered. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)`. + func projectsCreateViewForOrg(_ input: Operations.ProjectsCreateViewForOrg.Input) async throws -> Operations.ProjectsCreateViewForOrg.Output + /// List items for an organization project view + /// + /// List items in an organization project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)`. + func projectsListViewItemsForOrg(_ input: Operations.ProjectsListViewItemsForOrg.Input) async throws -> Operations.ProjectsListViewItemsForOrg.Output + /// Create draft item for user owned project + /// + /// Create draft issue item for the specified user owned project. + /// + /// - Remark: HTTP `POST /user/{user_id}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)`. + func projectsCreateDraftItemForAuthenticatedUser(_ input: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output + /// Create a view for a user-owned project + /// + /// Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)`. + func projectsCreateViewForUser(_ input: Operations.ProjectsCreateViewForUser.Input) async throws -> Operations.ProjectsCreateViewForUser.Output /// List projects for user /// /// List all projects owned by a specific user accessible by the authenticated user. @@ -95,6 +137,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output + /// Add field to user owned project + /// + /// Add a field to a specified user owned project. + /// + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)`. + func projectsAddFieldForUser(_ input: Operations.ProjectsAddFieldForUser.Input) async throws -> Operations.ProjectsAddFieldForUser.Output /// Get project field for user /// /// Get a specific field for a user-owned project. @@ -137,6 +186,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output + /// List items for a user project view + /// + /// List items in a user project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)`. + func projectsListViewItemsForUser(_ input: Operations.ProjectsListViewItemsForUser.Input) async throws -> Operations.ProjectsListViewItemsForUser.Output } /// Convenience overloads for operation inputs. @@ -173,6 +229,23 @@ extension APIProtocol { headers: headers )) } + /// Create draft item for organization owned project + /// + /// Create draft issue item for the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)`. + public func projectsCreateDraftItemForOrg( + path: Operations.ProjectsCreateDraftItemForOrg.Input.Path, + headers: Operations.ProjectsCreateDraftItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsCreateDraftItemForOrg.Input.Body + ) async throws -> Operations.ProjectsCreateDraftItemForOrg.Output { + try await projectsCreateDraftItemForOrg(Operations.ProjectsCreateDraftItemForOrg.Input( + path: path, + headers: headers, + body: body + )) + } /// List project fields for organization /// /// List all fields for a specific organization-owned project. @@ -190,6 +263,23 @@ extension APIProtocol { headers: headers )) } + /// Add a field to an organization-owned project. + /// + /// Add a field to an organization-owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)`. + public func projectsAddFieldForOrg( + path: Operations.ProjectsAddFieldForOrg.Input.Path, + headers: Operations.ProjectsAddFieldForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddFieldForOrg.Input.Body + ) async throws -> Operations.ProjectsAddFieldForOrg.Output { + try await projectsAddFieldForOrg(Operations.ProjectsAddFieldForOrg.Input( + path: path, + headers: headers, + body: body + )) + } /// Get project field for organization /// /// Get a specific field for an organization-owned project. @@ -288,6 +378,74 @@ extension APIProtocol { headers: headers )) } + /// Create a view for an organization-owned project + /// + /// Create a new view in an organization-owned project. Views allow you to customize how items in a project are displayed and filtered. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)`. + public func projectsCreateViewForOrg( + path: Operations.ProjectsCreateViewForOrg.Input.Path, + headers: Operations.ProjectsCreateViewForOrg.Input.Headers = .init(), + body: Operations.ProjectsCreateViewForOrg.Input.Body + ) async throws -> Operations.ProjectsCreateViewForOrg.Output { + try await projectsCreateViewForOrg(Operations.ProjectsCreateViewForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// List items for an organization project view + /// + /// List items in an organization project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)`. + public func projectsListViewItemsForOrg( + path: Operations.ProjectsListViewItemsForOrg.Input.Path, + query: Operations.ProjectsListViewItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListViewItemsForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListViewItemsForOrg.Output { + try await projectsListViewItemsForOrg(Operations.ProjectsListViewItemsForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create draft item for user owned project + /// + /// Create draft issue item for the specified user owned project. + /// + /// - Remark: HTTP `POST /user/{user_id}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)`. + public func projectsCreateDraftItemForAuthenticatedUser( + path: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Path, + headers: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Body + ) async throws -> Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output { + try await projectsCreateDraftItemForAuthenticatedUser(Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input( + path: path, + headers: headers, + body: body + )) + } + /// Create a view for a user-owned project + /// + /// Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)`. + public func projectsCreateViewForUser( + path: Operations.ProjectsCreateViewForUser.Input.Path, + headers: Operations.ProjectsCreateViewForUser.Input.Headers = .init(), + body: Operations.ProjectsCreateViewForUser.Input.Body + ) async throws -> Operations.ProjectsCreateViewForUser.Output { + try await projectsCreateViewForUser(Operations.ProjectsCreateViewForUser.Input( + path: path, + headers: headers, + body: body + )) + } /// List projects for user /// /// List all projects owned by a specific user accessible by the authenticated user. @@ -337,6 +495,23 @@ extension APIProtocol { headers: headers )) } + /// Add field to user owned project + /// + /// Add a field to a specified user owned project. + /// + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)`. + public func projectsAddFieldForUser( + path: Operations.ProjectsAddFieldForUser.Input.Path, + headers: Operations.ProjectsAddFieldForUser.Input.Headers = .init(), + body: Operations.ProjectsAddFieldForUser.Input.Body + ) async throws -> Operations.ProjectsAddFieldForUser.Output { + try await projectsAddFieldForUser(Operations.ProjectsAddFieldForUser.Input( + path: path, + headers: headers, + body: body + )) + } /// Get project field for user /// /// Get a specific field for a user-owned project. @@ -435,6 +610,23 @@ extension APIProtocol { headers: headers )) } + /// List items for a user project view + /// + /// List items in a user project with the saved view's filter applied. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)`. + public func projectsListViewItemsForUser( + path: Operations.ProjectsListViewItemsForUser.Input.Path, + query: Operations.ProjectsListViewItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListViewItemsForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListViewItemsForUser.Output { + try await projectsListViewItemsForUser(Operations.ProjectsListViewItemsForUser.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -753,8 +945,8 @@ public enum Components { case case2(Swift.Int?) /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -779,7 +971,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -1252,6 +1444,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether commit comments are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. + public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1497,6 +1708,9 @@ public enum Components { /// - hasPages: /// - hasDownloads: Whether downloads are enabled. /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1594,6 +1808,9 @@ public enum Components { hasPages: Swift.Bool, hasDownloads: Swift.Bool, hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1691,6 +1908,9 @@ public enum Components { self.hasPages = hasPages self.hasDownloads = hasDownloads self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -1789,6 +2009,9 @@ public enum Components { case hasPages = "has_pages" case hasDownloads = "has_downloads" case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2051,8 +2274,8 @@ public enum Components { case SimpleUser(Components.Schemas.SimpleUser) /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. case Enterprise(Components.Schemas.Enterprise) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .SimpleUser(try .init(from: decoder)) return @@ -2071,7 +2294,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .SimpleUser(value): try value.encode(to: encoder) @@ -2143,7 +2366,7 @@ public enum Components { case contents case deployments } - public init(from decoder: any Decoder) throws { + public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.issues = try container.decodeIfPresent( Swift.String.self, @@ -2173,7 +2396,7 @@ public enum Components { "deployments" ]) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( self.issues, @@ -2388,6 +2611,140 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// Context around who pinned an issue comment and when it was pinned. + /// + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment`. + public struct NullablePinnedIssueComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_at`. + public var pinnedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-pinned-issue-comment/pinned_by`. + public var pinnedBy: Components.Schemas.NullableSimpleUser? + /// Creates a new `NullablePinnedIssueComment`. + /// + /// - Parameters: + /// - pinnedAt: + /// - pinnedBy: + public init( + pinnedAt: Foundation.Date, + pinnedBy: Components.Schemas.NullableSimpleUser? = nil + ) { + self.pinnedAt = pinnedAt + self.pinnedBy = pinnedBy + } + public enum CodingKeys: String, CodingKey { + case pinnedAt = "pinned_at" + case pinnedBy = "pinned_by" + } + } + /// Comments provide a way for people to collaborate on an issue. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment`. + public struct NullableIssueComment: Codable, Hashable, Sendable { + /// Unique identifier of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/node_id`. + public var nodeId: Swift.String + /// URL for the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/url`. + public var url: Swift.String + /// Contents of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/nullable-issue-comment/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? + /// Creates a new `NullableIssueComment`. + /// + /// - Parameters: + /// - id: Unique identifier of the issue comment + /// - nodeId: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment + /// - bodyText: + /// - bodyHtml: + /// - htmlUrl: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - issueUrl: + /// - authorAssociation: + /// - performedViaGithubApp: + /// - reactions: + /// - pin: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + bodyText: Swift.String? = nil, + bodyHtml: Swift.String? = nil, + htmlUrl: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + issueUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.body = body + self.bodyText = bodyText + self.bodyHtml = bodyHtml + self.htmlUrl = htmlUrl + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + self.issueUrl = issueUrl + self.authorAssociation = authorAssociation + self.performedViaGithubApp = performedViaGithubApp + self.reactions = reactions + self.pin = pin + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case body + case bodyText = "body_text" + case bodyHtml = "body_html" + case htmlUrl = "html_url" + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + case issueUrl = "issue_url" + case authorAssociation = "author_association" + case performedViaGithubApp = "performed_via_github_app" + case reactions + case pin + } + } /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. public struct IssueDependenciesSummary: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. @@ -2471,8 +2828,8 @@ public enum Components { self.value2 = value2 self.value3 = value3 } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self.value1 = try decoder.decodeFromSingleValueContainer() } catch { @@ -2499,7 +2856,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { try encoder.encodeFirstNonNilValueToSingleValueContainer([ self.value1, self.value2, @@ -2693,8 +3050,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. case case2(Components.Schemas.Issue.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -2713,7 +3070,7 @@ public enum Components { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -2817,6 +3174,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pinned_comment`. + public var pinnedComment: Components.Schemas.NullableIssueComment? /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. @@ -2861,6 +3220,7 @@ public enum Components { /// - reactions: /// - subIssuesSummary: /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - pinnedComment: /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -2901,6 +3261,7 @@ public enum Components { reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, parentIssueUrl: Swift.String? = nil, + pinnedComment: Components.Schemas.NullableIssueComment? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -2941,6 +3302,7 @@ public enum Components { self.reactions = reactions self.subIssuesSummary = subIssuesSummary self.parentIssueUrl = parentIssueUrl + self.pinnedComment = pinnedComment self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -2982,6 +3344,7 @@ public enum Components { case reactions case subIssuesSummary = "sub_issues_summary" case parentIssueUrl = "parent_issue_url" + case pinnedComment = "pinned_comment" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -3542,315 +3905,564 @@ public enum Components { case isTemplate = "is_template" } } - /// An option for a single select field + /// Hypermedia Link /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options`. - public struct ProjectsV2SingleSelectOptions: Codable, Hashable, Sendable { - /// The unique identifier of the option. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/id`. - public var id: Swift.String - /// The display name of the option, in raw text and HTML formats. + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. - public struct NamePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/raw`. - public var raw: Swift.String - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/html`. - public var html: Swift.String - /// Creates a new `NamePayload`. - /// - /// - Parameters: - /// - raw: - /// - html: - public init( - raw: Swift.String, - html: Swift.String - ) { - self.raw = raw - self.html = html - } - public enum CodingKeys: String, CodingKey { - case raw - case html - } + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href } - /// The display name of the option, in raw text and HTML formats. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. - public var name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload - /// The description of the option, in raw text and HTML formats. + public enum CodingKeys: String, CodingKey { + case href + } + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. - public struct DescriptionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/raw`. - public var raw: Swift.String - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/html`. - public var html: Swift.String - /// Creates a new `DescriptionPayload`. - /// - /// - Parameters: - /// - raw: - /// - html: - public init( - raw: Swift.String, - html: Swift.String - ) { - self.raw = raw - self.html = html - } - public enum CodingKeys: String, CodingKey { - case raw - case html - } + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" } - /// The description of the option, in raw text and HTML formats. + /// The merge method to use. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. - public var description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload - /// The color associated with the option. + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/color`. - public var color: Swift.String - /// Creates a new `ProjectsV2SingleSelectOptions`. + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. /// /// - Parameters: - /// - id: The unique identifier of the option. - /// - name: The display name of the option, in raw text and HTML formats. - /// - description: The description of the option, in raw text and HTML formats. - /// - color: The color associated with the option. + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. public init( - id: Swift.String, - name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload, - description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload, - color: Swift.String + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String ) { - self.id = id - self.name = name - self.description = description - self.color = color + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage } public enum CodingKeys: String, CodingKey { - case id - case name - case description - case color + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" } } - /// An iteration setting for an iteration field + /// Pull Request Simple /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings`. - public struct ProjectsV2IterationSettings: Codable, Hashable, Sendable { - /// The unique identifier of the iteration setting. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/id`. - public var id: Swift.String - /// The start date of the iteration. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/start_date`. - public var startDate: Swift.String - /// The duration of the iteration in days. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/duration`. - public var duration: Swift.Int - /// The iteration title, in raw text and HTML formats. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. - public struct TitlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/raw`. - public var raw: Swift.String - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/html`. - public var html: Swift.String - /// Creates a new `TitlePayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. /// /// - Parameters: - /// - raw: - /// - html: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: public init( - raw: Swift.String, - html: Swift.String + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool ) { - self.raw = raw - self.html = html + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default } public enum CodingKeys: String, CodingKey { - case raw - case html + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" } } - /// The iteration title, in raw text and HTML formats. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. - public var title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload - /// Whether the iteration has been completed. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/completed`. - public var completed: Swift.Bool - /// Creates a new `ProjectsV2IterationSettings`. - /// - /// - Parameters: - /// - id: The unique identifier of the iteration setting. - /// - startDate: The start date of the iteration. - /// - duration: The duration of the iteration in days. - /// - title: The iteration title, in raw text and HTML formats. - /// - completed: Whether the iteration has been completed. - public init( - id: Swift.String, - startDate: Swift.String, - duration: Swift.Int, - title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload, - completed: Swift.Bool - ) { - self.id = id - self.startDate = startDate - self.duration = duration - self.title = title - self.completed = completed + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } } - public enum CodingKeys: String, CodingKey { - case id - case startDate = "start_date" - case duration - case title - case completed - } - } - /// A field inside a projects v2 project - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field`. - public struct ProjectsV2Field: Codable, Hashable, Sendable { - /// The unique identifier of the field. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/id`. - public var id: Swift.Int - /// The node ID of the field. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/node_id`. - public var nodeId: Swift.String? - /// The API URL of the project that contains the field. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/project_url`. - public var projectUrl: Swift.String - /// The name of the field. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/name`. - public var name: Swift.String - /// The field's data type. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. - @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case assignees = "assignees" - case linkedPullRequests = "linked_pull_requests" - case reviewers = "reviewers" - case labels = "labels" - case milestone = "milestone" - case repository = "repository" - case title = "title" - case text = "text" - case singleSelect = "single_select" - case number = "number" - case date = "date" - case iteration = "iteration" - case issueType = "issue_type" - case parentIssue = "parent_issue" - case subIssuesProgress = "sub_issues_progress" - } - /// The field's data type. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. - public var dataType: Components.Schemas.ProjectsV2Field.DataTypePayload - /// The options available for single select fields. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/options`. - public var options: [Components.Schemas.ProjectsV2SingleSelectOptions]? - /// Configuration for iteration fields. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. - public struct ConfigurationPayload: Codable, Hashable, Sendable { - /// The day of the week when the iteration starts. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/start_day`. - public var startDay: Swift.Int? - /// The duration of the iteration in days. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/duration`. - public var duration: Swift.Int? - /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/iterations`. - public var iterations: [Components.Schemas.ProjectsV2IterationSettings]? - /// Creates a new `ConfigurationPayload`. + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. /// /// - Parameters: - /// - startDay: The day of the week when the iteration starts. - /// - duration: The duration of the iteration in days. - /// - iterations: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: public init( - startDay: Swift.Int? = nil, - duration: Swift.Int? = nil, - iterations: [Components.Schemas.ProjectsV2IterationSettings]? = nil + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link ) { - self.startDay = startDay - self.duration = duration - self.iterations = iterations + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self } public enum CodingKeys: String, CodingKey { - case startDay = "start_day" - case duration - case iterations + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" } } - /// Configuration for iteration fields. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. - public var configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? - /// The time when the field was created. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/created_at`. - public var createdAt: Foundation.Date - /// The time when the field was last updated. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-field/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `ProjectsV2Field`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. /// /// - Parameters: - /// - id: The unique identifier of the field. - /// - nodeId: The node ID of the field. - /// - projectUrl: The API URL of the project that contains the field. - /// - name: The name of the field. - /// - dataType: The field's data type. - /// - options: The options available for single select fields. - /// - configuration: Configuration for iteration fields. - /// - createdAt: The time when the field was created. - /// - updatedAt: The time when the field was last updated. + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. public init( - id: Swift.Int, - nodeId: Swift.String? = nil, - projectUrl: Swift.String, - name: Swift.String, - dataType: Components.Schemas.ProjectsV2Field.DataTypePayload, - options: [Components.Schemas.ProjectsV2SingleSelectOptions]? = nil, - configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.id = id - self.nodeId = nodeId - self.projectUrl = projectUrl - self.name = name - self.dataType = dataType - self.options = options - self.configuration = configuration + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason self.createdAt = createdAt self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft } public enum CodingKeys: String, CodingKey { + case url case id case nodeId = "node_id" - case projectUrl = "project_url" - case name - case dataType = "data_type" - case options - case configuration + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft + } + } + /// A draft issue in a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue`. + public struct ProjectsV2DraftIssue: Codable, Hashable, Sendable { + /// The ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/id`. + public var id: Swift.Double + /// The node ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/node_id`. + public var nodeId: Swift.String + /// The title of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/title`. + public var title: Swift.String + /// The body content of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// The time the draft issue was created + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/created_at`. + public var createdAt: Foundation.Date + /// The time the draft issue was last updated + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectsV2DraftIssue`. + /// + /// - Parameters: + /// - id: The ID of the draft issue + /// - nodeId: The node ID of the draft issue + /// - title: The title of the draft issue + /// - body: The body content of the draft issue + /// - user: + /// - createdAt: The time the draft issue was created + /// - updatedAt: The time the draft issue was last updated + public init( + id: Swift.Double, + nodeId: Swift.String, + title: Swift.String, + body: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.nodeId = nodeId + self.title = title + self.body = body + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case title + case body + case user case createdAt = "created_at" case updatedAt = "updated_at" } @@ -3865,839 +4477,960 @@ public enum Components { } /// An item belonging to a project /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content`. - public struct ProjectsV2ItemWithContent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple`. + public struct ProjectsV2ItemSimple: Codable, Hashable, Sendable { /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/id`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/id`. public var id: Swift.Double /// The node ID of the project item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/node_id`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/node_id`. public var nodeId: Swift.String? - /// The API URL of the project that contains this item. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/project_url`. - public var projectUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content_type`. - public var contentType: Components.Schemas.ProjectsV2ItemContentType - /// The content of the item, which varies by content type. + /// The content represented by the item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. - public struct ContentPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `ContentPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + @frozen public enum ContentPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case1`. + case Issue(Components.Schemas.Issue) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case2`. + case PullRequestSimple(Components.Schemas.PullRequestSimple) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case3`. + case ProjectsV2DraftIssue(Components.Schemas.ProjectsV2DraftIssue) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .Issue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ProjectsV2DraftIssue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .Issue(value): + try value.encode(to: encoder) + case let .PullRequestSimple(value): + try value.encode(to: encoder) + case let .ProjectsV2DraftIssue(value): + try value.encode(to: encoder) + } } } - /// The content of the item, which varies by content type. + /// The content represented by the item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. - public var content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/creator`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + public var content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/creator`. public var creator: Components.Schemas.SimpleUser? /// The time when the item was created. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/created_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/created_at`. public var createdAt: Foundation.Date /// The time when the item was last updated. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/updated_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/updated_at`. public var updatedAt: Foundation.Date /// The time when the item was archived. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/archived_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/archived_at`. public var archivedAt: Foundation.Date? - /// The API URL of this item. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/item_url`. - public var itemUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/FieldsPayload`. - public struct FieldsPayloadPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `FieldsPayloadPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// The fields and values associated with this item. + /// The URL of the project this item belongs to. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. - public typealias FieldsPayload = [Components.Schemas.ProjectsV2ItemWithContent.FieldsPayloadPayload] - /// The fields and values associated with this item. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/project_url`. + public var projectUrl: Swift.String? + /// The URL of the item in the project. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. - public var fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? - /// Creates a new `ProjectsV2ItemWithContent`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/item_url`. + public var itemUrl: Swift.String? + /// Creates a new `ProjectsV2ItemSimple`. /// /// - Parameters: /// - id: The unique identifier of the project item. /// - nodeId: The node ID of the project item. - /// - projectUrl: The API URL of the project that contains this item. + /// - content: The content represented by the item. /// - contentType: - /// - content: The content of the item, which varies by content type. /// - creator: /// - createdAt: The time when the item was created. /// - updatedAt: The time when the item was last updated. /// - archivedAt: The time when the item was archived. - /// - itemUrl: The API URL of this item. - /// - fields: The fields and values associated with this item. + /// - projectUrl: The URL of the project this item belongs to. + /// - itemUrl: The URL of the item in the project. public init( id: Swift.Double, nodeId: Swift.String? = nil, - projectUrl: Swift.String? = nil, + content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? = nil, contentType: Components.Schemas.ProjectsV2ItemContentType, - content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? = nil, creator: Components.Schemas.SimpleUser? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date, archivedAt: Foundation.Date? = nil, - itemUrl: Swift.String? = nil, - fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? = nil + projectUrl: Swift.String? = nil, + itemUrl: Swift.String? = nil ) { self.id = id self.nodeId = nodeId - self.projectUrl = projectUrl - self.contentType = contentType self.content = content + self.contentType = contentType self.creator = creator self.createdAt = createdAt self.updatedAt = updatedAt self.archivedAt = archivedAt + self.projectUrl = projectUrl self.itemUrl = itemUrl - self.fields = fields } public enum CodingKeys: String, CodingKey { case id case nodeId = "node_id" - case projectUrl = "project_url" - case contentType = "content_type" case content + case contentType = "content_type" case creator case createdAt = "created_at" case updatedAt = "updated_at" case archivedAt = "archived_at" + case projectUrl = "project_url" case itemUrl = "item_url" - case fields } } - /// Hypermedia Link + /// An option for a single select field /// - /// - Remark: Generated from `#/components/schemas/link`. - public struct Link: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link/href`. - public var href: Swift.String - /// Creates a new `Link`. + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options`. + public struct ProjectsV2SingleSelectOptions: Codable, Hashable, Sendable { + /// The unique identifier of the option. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/id`. + public var id: Swift.String + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public struct NamePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/html`. + public var html: Swift.String + /// Creates a new `NamePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public var name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload + /// The description of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public struct DescriptionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/html`. + public var html: Swift.String + /// Creates a new `DescriptionPayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The description of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public var description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload + /// The color associated with the option. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/color`. + public var color: Swift.String + /// Creates a new `ProjectsV2SingleSelectOptions`. /// /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href + /// - id: The unique identifier of the option. + /// - name: The display name of the option, in raw text and HTML formats. + /// - description: The description of the option, in raw text and HTML formats. + /// - color: The color associated with the option. + public init( + id: Swift.String, + name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload, + description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload, + color: Swift.String + ) { + self.id = id + self.name = name + self.description = description + self.color = color } public enum CodingKeys: String, CodingKey { - case href + case id + case name + case description + case color } } - /// The status of auto merging a pull request. + /// An iteration setting for an iteration field /// - /// - Remark: Generated from `#/components/schemas/auto-merge`. - public struct AutoMerge: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. - public var enabledBy: Components.Schemas.SimpleUser - /// The merge method to use. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings`. + public struct ProjectsV2IterationSettings: Codable, Hashable, Sendable { + /// The unique identifier of the iteration setting. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" - } - /// The merge method to use. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/id`. + public var id: Swift.String + /// The start date of the iteration. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload - /// Title for the merge commit message. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/start_date`. + public var startDate: Swift.String + /// The duration of the iteration in days. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. - public var commitTitle: Swift.String - /// Commit message for the merge commit. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/duration`. + public var duration: Swift.Int + /// The iteration title, in raw text and HTML formats. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. - public var commitMessage: Swift.String - /// Creates a new `AutoMerge`. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public struct TitlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/html`. + public var html: Swift.String + /// Creates a new `TitlePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The iteration title, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public var title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload + /// Whether the iteration has been completed. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/completed`. + public var completed: Swift.Bool + /// Creates a new `ProjectsV2IterationSettings`. /// /// - Parameters: - /// - enabledBy: - /// - mergeMethod: The merge method to use. - /// - commitTitle: Title for the merge commit message. - /// - commitMessage: Commit message for the merge commit. + /// - id: The unique identifier of the iteration setting. + /// - startDate: The start date of the iteration. + /// - duration: The duration of the iteration in days. + /// - title: The iteration title, in raw text and HTML formats. + /// - completed: Whether the iteration has been completed. public init( - enabledBy: Components.Schemas.SimpleUser, - mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, - commitTitle: Swift.String, - commitMessage: Swift.String + id: Swift.String, + startDate: Swift.String, + duration: Swift.Int, + title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload, + completed: Swift.Bool ) { - self.enabledBy = enabledBy - self.mergeMethod = mergeMethod - self.commitTitle = commitTitle - self.commitMessage = commitMessage + self.id = id + self.startDate = startDate + self.duration = duration + self.title = title + self.completed = completed } public enum CodingKeys: String, CodingKey { - case enabledBy = "enabled_by" - case mergeMethod = "merge_method" - case commitTitle = "commit_title" - case commitMessage = "commit_message" + case id + case startDate = "start_date" + case duration + case title + case completed } } - /// Pull Request Simple + /// A field inside a projects v2 project /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple`. - public struct PullRequestSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. - public var diffUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. - public var patchUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. - public var reviewCommentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. - public var reviewCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. - public var locked: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. - public var description: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. - public var color: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. - public var _default: Swift.Bool - /// Creates a new `LabelsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/projects-v2-field`. + public struct ProjectsV2Field: Codable, Hashable, Sendable { + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/id`. + public var id: Swift.Int + /// The ID of the issue field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/issue_field_id`. + public var issueFieldId: Swift.Int? + /// The node ID of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/node_id`. + public var nodeId: Swift.String? + /// The API URL of the project that contains the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/project_url`. + public var projectUrl: Swift.String + /// The name of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case assignees = "assignees" + case linkedPullRequests = "linked_pull_requests" + case reviewers = "reviewers" + case labels = "labels" + case milestone = "milestone" + case repository = "repository" + case title = "title" + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + case iteration = "iteration" + case issueType = "issue_type" + case parentIssue = "parent_issue" + case subIssuesProgress = "sub_issues_progress" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + public var dataType: Components.Schemas.ProjectsV2Field.DataTypePayload + /// The options available for single select fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/options`. + public var options: [Components.Schemas.ProjectsV2SingleSelectOptions]? + /// Configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public struct ConfigurationPayload: Codable, Hashable, Sendable { + /// The day of the week when the iteration starts. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/start_day`. + public var startDay: Swift.Int? + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/duration`. + public var duration: Swift.Int? + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/iterations`. + public var iterations: [Components.Schemas.ProjectsV2IterationSettings]? + /// Creates a new `ConfigurationPayload`. /// /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - name: - /// - description: - /// - color: - /// - _default: + /// - startDay: The day of the week when the iteration starts. + /// - duration: The duration of the iteration in days. + /// - iterations: public init( - id: Swift.Int64, - nodeId: Swift.String, - url: Swift.String, - name: Swift.String, - description: Swift.String, - color: Swift.String, - _default: Swift.Bool + startDay: Swift.Int? = nil, + duration: Swift.Int? = nil, + iterations: [Components.Schemas.ProjectsV2IterationSettings]? = nil ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default + self.startDay = startDay + self.duration = duration + self.iterations = iterations } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case name - case description - case color - case _default = "default" + case startDay = "start_day" + case duration + case iterations } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public var labels: Components.Schemas.PullRequestSimple.LabelsPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. - public var milestone: Components.Schemas.NullableMilestone? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. - public var activeLockReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + /// Configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public var configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? + /// The time when the field was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/created_at`. public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + /// The time when the field was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/updated_at`. public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. - public var mergedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. - public var mergeCommitSha: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. - public var assignees: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. - public var requestedReviewers: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. - public var requestedTeams: [Components.Schemas.Team]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public var head: Components.Schemas.PullRequestSimple.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `BasePayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public var base: Components.Schemas.PullRequestSimple.BasePayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. - public var comments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. - public var commits: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. - public var statuses: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. - public var html: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. - public var issue: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. - public var reviewComments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. - public var reviewComment: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. - public var _self: Components.Schemas.Link - /// Creates a new `_LinksPayload`. - /// - /// - Parameters: - /// - comments: - /// - commits: - /// - statuses: - /// - html: - /// - issue: - /// - reviewComments: - /// - reviewComment: - /// - _self: - public init( - comments: Components.Schemas.Link, - commits: Components.Schemas.Link, - statuses: Components.Schemas.Link, - html: Components.Schemas.Link, - issue: Components.Schemas.Link, - reviewComments: Components.Schemas.Link, - reviewComment: Components.Schemas.Link, - _self: Components.Schemas.Link - ) { - self.comments = comments - self.commits = commits - self.statuses = statuses - self.html = html - self.issue = issue - self.reviewComments = reviewComments - self.reviewComment = reviewComment - self._self = _self - } - public enum CodingKeys: String, CodingKey { - case comments - case commits - case statuses - case html - case issue - case reviewComments = "review_comments" - case reviewComment = "review_comment" - case _self = "self" - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public var _links: Components.Schemas.PullRequestSimple._LinksPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. - public var autoMerge: Components.Schemas.AutoMerge? - /// Indicates whether or not the pull request is a draft. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. - public var draft: Swift.Bool? - /// Creates a new `PullRequestSimple`. + /// Creates a new `ProjectsV2Field`. /// /// - Parameters: - /// - url: - /// - id: - /// - nodeId: - /// - htmlUrl: - /// - diffUrl: - /// - patchUrl: - /// - issueUrl: - /// - commitsUrl: - /// - reviewCommentsUrl: - /// - reviewCommentUrl: - /// - commentsUrl: - /// - statusesUrl: - /// - number: - /// - state: - /// - locked: - /// - title: - /// - user: - /// - body: - /// - labels: - /// - milestone: - /// - activeLockReason: - /// - createdAt: - /// - updatedAt: - /// - closedAt: - /// - mergedAt: - /// - mergeCommitSha: - /// - assignee: - /// - assignees: - /// - requestedReviewers: - /// - requestedTeams: - /// - head: - /// - base: - /// - _links: - /// - authorAssociation: - /// - autoMerge: - /// - draft: Indicates whether or not the pull request is a draft. + /// - id: The unique identifier of the field. + /// - issueFieldId: The ID of the issue field. + /// - nodeId: The node ID of the field. + /// - projectUrl: The API URL of the project that contains the field. + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - options: The options available for single select fields. + /// - configuration: Configuration for iteration fields. + /// - createdAt: The time when the field was created. + /// - updatedAt: The time when the field was last updated. public init( - url: Swift.String, - id: Swift.Int64, - nodeId: Swift.String, - htmlUrl: Swift.String, - diffUrl: Swift.String, - patchUrl: Swift.String, - issueUrl: Swift.String, - commitsUrl: Swift.String, - reviewCommentsUrl: Swift.String, - reviewCommentUrl: Swift.String, - commentsUrl: Swift.String, - statusesUrl: Swift.String, - number: Swift.Int, - state: Swift.String, - locked: Swift.Bool, - title: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String? = nil, - labels: Components.Schemas.PullRequestSimple.LabelsPayload, - milestone: Components.Schemas.NullableMilestone? = nil, - activeLockReason: Swift.String? = nil, + id: Swift.Int, + issueFieldId: Swift.Int? = nil, + nodeId: Swift.String? = nil, + projectUrl: Swift.String, + name: Swift.String, + dataType: Components.Schemas.ProjectsV2Field.DataTypePayload, + options: [Components.Schemas.ProjectsV2SingleSelectOptions]? = nil, + configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? = nil, createdAt: Foundation.Date, - updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - mergedAt: Foundation.Date? = nil, - mergeCommitSha: Swift.String? = nil, - assignee: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil, - requestedReviewers: [Components.Schemas.SimpleUser]? = nil, - requestedTeams: [Components.Schemas.Team]? = nil, - head: Components.Schemas.PullRequestSimple.HeadPayload, - base: Components.Schemas.PullRequestSimple.BasePayload, - _links: Components.Schemas.PullRequestSimple._LinksPayload, - authorAssociation: Components.Schemas.AuthorAssociation, - autoMerge: Components.Schemas.AutoMerge? = nil, - draft: Swift.Bool? = nil + updatedAt: Foundation.Date ) { - self.url = url self.id = id + self.issueFieldId = issueFieldId self.nodeId = nodeId - self.htmlUrl = htmlUrl - self.diffUrl = diffUrl - self.patchUrl = patchUrl - self.issueUrl = issueUrl - self.commitsUrl = commitsUrl - self.reviewCommentsUrl = reviewCommentsUrl - self.reviewCommentUrl = reviewCommentUrl - self.commentsUrl = commentsUrl - self.statusesUrl = statusesUrl - self.number = number - self.state = state - self.locked = locked - self.title = title - self.user = user - self.body = body - self.labels = labels - self.milestone = milestone - self.activeLockReason = activeLockReason + self.projectUrl = projectUrl + self.name = name + self.dataType = dataType + self.options = options + self.configuration = configuration self.createdAt = createdAt self.updatedAt = updatedAt - self.closedAt = closedAt - self.mergedAt = mergedAt - self.mergeCommitSha = mergeCommitSha - self.assignee = assignee - self.assignees = assignees - self.requestedReviewers = requestedReviewers - self.requestedTeams = requestedTeams - self.head = head - self.base = base - self._links = _links - self.authorAssociation = authorAssociation - self.autoMerge = autoMerge - self.draft = draft } public enum CodingKeys: String, CodingKey { - case url case id + case issueFieldId = "issue_field_id" case nodeId = "node_id" - case htmlUrl = "html_url" - case diffUrl = "diff_url" - case patchUrl = "patch_url" - case issueUrl = "issue_url" - case commitsUrl = "commits_url" - case reviewCommentsUrl = "review_comments_url" - case reviewCommentUrl = "review_comment_url" - case commentsUrl = "comments_url" - case statusesUrl = "statuses_url" - case number - case state - case locked - case title - case user - case body - case labels - case milestone - case activeLockReason = "active_lock_reason" + case projectUrl = "project_url" + case name + case dataType = "data_type" + case options + case configuration case createdAt = "created_at" case updatedAt = "updated_at" - case closedAt = "closed_at" - case mergedAt = "merged_at" - case mergeCommitSha = "merge_commit_sha" - case assignee - case assignees - case requestedReviewers = "requested_reviewers" - case requestedTeams = "requested_teams" - case head - case base - case _links - case authorAssociation = "author_association" - case autoMerge = "auto_merge" - case draft } } - /// A draft issue in a project - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue`. - public struct ProjectsV2DraftIssue: Codable, Hashable, Sendable { - /// The ID of the draft issue + /// - Remark: Generated from `#/components/schemas/projects-v2-field-single-select-option`. + public struct ProjectsV2FieldSingleSelectOption: Codable, Hashable, Sendable { + /// The display name of the option. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/id`. - public var id: Swift.Double - /// The node ID of the draft issue + /// - Remark: Generated from `#/components/schemas/projects-v2-field-single-select-option/name`. + public var name: Swift.String? + /// The color associated with the option. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/node_id`. - public var nodeId: Swift.String - /// The title of the draft issue + /// - Remark: Generated from `#/components/schemas/projects-v2-field-single-select-option/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case blue = "BLUE" + case gray = "GRAY" + case green = "GREEN" + case orange = "ORANGE" + case pink = "PINK" + case purple = "PURPLE" + case red = "RED" + case yellow = "YELLOW" + } + /// The color associated with the option. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/title`. - public var title: Swift.String - /// The body content of the draft issue + /// - Remark: Generated from `#/components/schemas/projects-v2-field-single-select-option/color`. + public var color: Components.Schemas.ProjectsV2FieldSingleSelectOption.ColorPayload? + /// The description of the option. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// The time the draft issue was created + /// - Remark: Generated from `#/components/schemas/projects-v2-field-single-select-option/description`. + public var description: Swift.String? + /// Creates a new `ProjectsV2FieldSingleSelectOption`. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/created_at`. - public var createdAt: Foundation.Date - /// The time the draft issue was last updated + /// - Parameters: + /// - name: The display name of the option. + /// - color: The color associated with the option. + /// - description: The description of the option. + public init( + name: Swift.String? = nil, + color: Components.Schemas.ProjectsV2FieldSingleSelectOption.ColorPayload? = nil, + description: Swift.String? = nil + ) { + self.name = name + self.color = color + self.description = description + } + public enum CodingKeys: String, CodingKey { + case name + case color + case description + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + self.color = try container.decodeIfPresent( + Components.Schemas.ProjectsV2FieldSingleSelectOption.ColorPayload.self, + forKey: .color + ) + self.description = try container.decodeIfPresent( + Swift.String.self, + forKey: .description + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "color", + "description" + ]) + } + } + /// The configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration`. + public struct ProjectsV2FieldIterationConfiguration: Codable, Hashable, Sendable { + /// The start date of the first iteration. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `ProjectsV2DraftIssue`. + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/start_date`. + public var startDate: Swift.String? + /// The default duration for iterations in days. Individual iterations can override this value. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/duration`. + public var duration: Swift.Int? + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/IterationsPayload`. + public struct IterationsPayloadPayload: Codable, Hashable, Sendable { + /// The title of the iteration. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/IterationsPayload/title`. + public var title: Swift.String? + /// The start date of the iteration. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/IterationsPayload/start_date`. + public var startDate: Swift.String? + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/IterationsPayload/duration`. + public var duration: Swift.Int? + /// Creates a new `IterationsPayloadPayload`. + /// + /// - Parameters: + /// - title: The title of the iteration. + /// - startDate: The start date of the iteration. + /// - duration: The duration of the iteration in days. + public init( + title: Swift.String? = nil, + startDate: Swift.String? = nil, + duration: Swift.Int? = nil + ) { + self.title = title + self.startDate = startDate + self.duration = duration + } + public enum CodingKeys: String, CodingKey { + case title + case startDate = "start_date" + case duration + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.title = try container.decodeIfPresent( + Swift.String.self, + forKey: .title + ) + self.startDate = try container.decodeIfPresent( + Swift.String.self, + forKey: .startDate + ) + self.duration = try container.decodeIfPresent( + Swift.Int.self, + forKey: .duration + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "title", + "start_date", + "duration" + ]) + } + } + /// Zero or more iterations for the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/iterations`. + public typealias IterationsPayload = [Components.Schemas.ProjectsV2FieldIterationConfiguration.IterationsPayloadPayload] + /// Zero or more iterations for the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field-iteration-configuration/iterations`. + public var iterations: Components.Schemas.ProjectsV2FieldIterationConfiguration.IterationsPayload? + /// Creates a new `ProjectsV2FieldIterationConfiguration`. /// /// - Parameters: - /// - id: The ID of the draft issue - /// - nodeId: The node ID of the draft issue - /// - title: The title of the draft issue - /// - body: The body content of the draft issue - /// - user: - /// - createdAt: The time the draft issue was created - /// - updatedAt: The time the draft issue was last updated + /// - startDate: The start date of the first iteration. + /// - duration: The default duration for iterations in days. Individual iterations can override this value. + /// - iterations: Zero or more iterations for the field. public init( - id: Swift.Double, - nodeId: Swift.String, - title: Swift.String, - body: Swift.String? = nil, - user: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date + startDate: Swift.String? = nil, + duration: Swift.Int? = nil, + iterations: Components.Schemas.ProjectsV2FieldIterationConfiguration.IterationsPayload? = nil ) { - self.id = id - self.nodeId = nodeId - self.title = title - self.body = body - self.user = user - self.createdAt = createdAt - self.updatedAt = updatedAt + self.startDate = startDate + self.duration = duration + self.iterations = iterations } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case title - case body - case user - case createdAt = "created_at" - case updatedAt = "updated_at" + case startDate = "start_date" + case duration + case iterations } } /// An item belonging to a project /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple`. - public struct ProjectsV2ItemSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content`. + public struct ProjectsV2ItemWithContent: Codable, Hashable, Sendable { /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/id`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/id`. public var id: Swift.Double /// The node ID of the project item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/node_id`. public var nodeId: Swift.String? - /// The content represented by the item. + /// The API URL of the project that contains this item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. - @frozen public enum ContentPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case1`. - case Issue(Components.Schemas.Issue) - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case2`. - case PullRequestSimple(Components.Schemas.PullRequestSimple) - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case3`. - case ProjectsV2DraftIssue(Components.Schemas.ProjectsV2DraftIssue) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .Issue(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .PullRequestSimple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .ProjectsV2DraftIssue(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/project_url`. + public var projectUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// The content of the item, which varies by content type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public struct ContentPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ContentPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .Issue(value): - try value.encode(to: encoder) - case let .PullRequestSimple(value): - try value.encode(to: encoder) - case let .ProjectsV2DraftIssue(value): - try value.encode(to: encoder) - } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// The content represented by the item. + /// The content of the item, which varies by content type. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. - public var content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content_type`. - public var contentType: Components.Schemas.ProjectsV2ItemContentType - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/creator`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public var content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/creator`. public var creator: Components.Schemas.SimpleUser? /// The time when the item was created. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/created_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/created_at`. public var createdAt: Foundation.Date /// The time when the item was last updated. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/updated_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/updated_at`. public var updatedAt: Foundation.Date /// The time when the item was archived. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/archived_at`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/archived_at`. public var archivedAt: Foundation.Date? - /// The URL of the project this item belongs to. - /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/project_url`. - public var projectUrl: Swift.String? - /// The URL of the item in the project. + /// The API URL of this item. /// - /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/item_url`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/item_url`. public var itemUrl: Swift.String? - /// Creates a new `ProjectsV2ItemSimple`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The fields and values associated with this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public typealias FieldsPayload = [Components.Schemas.ProjectsV2ItemWithContent.FieldsPayloadPayload] + /// The fields and values associated with this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public var fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? + /// Creates a new `ProjectsV2ItemWithContent`. /// /// - Parameters: /// - id: The unique identifier of the project item. /// - nodeId: The node ID of the project item. - /// - content: The content represented by the item. + /// - projectUrl: The API URL of the project that contains this item. /// - contentType: + /// - content: The content of the item, which varies by content type. /// - creator: /// - createdAt: The time when the item was created. /// - updatedAt: The time when the item was last updated. /// - archivedAt: The time when the item was archived. - /// - projectUrl: The URL of the project this item belongs to. - /// - itemUrl: The URL of the item in the project. + /// - itemUrl: The API URL of this item. + /// - fields: The fields and values associated with this item. public init( id: Swift.Double, nodeId: Swift.String? = nil, - content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? = nil, + projectUrl: Swift.String? = nil, contentType: Components.Schemas.ProjectsV2ItemContentType, + content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? = nil, creator: Components.Schemas.SimpleUser? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date, archivedAt: Foundation.Date? = nil, - projectUrl: Swift.String? = nil, - itemUrl: Swift.String? = nil + itemUrl: Swift.String? = nil, + fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? = nil ) { self.id = id self.nodeId = nodeId - self.content = content + self.projectUrl = projectUrl self.contentType = contentType + self.content = content self.creator = creator self.createdAt = createdAt self.updatedAt = updatedAt self.archivedAt = archivedAt - self.projectUrl = projectUrl self.itemUrl = itemUrl + self.fields = fields } public enum CodingKeys: String, CodingKey { case id case nodeId = "node_id" - case content + case projectUrl = "project_url" case contentType = "content_type" + case content case creator case createdAt = "created_at" case updatedAt = "updated_at" case archivedAt = "archived_at" - case projectUrl = "project_url" case itemUrl = "item_url" + case fields + } + } + /// A view inside a projects v2 project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view`. + public struct ProjectsV2View: Codable, Hashable, Sendable { + /// The unique identifier of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/id`. + public var id: Swift.Int + /// The number of the view within the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/number`. + public var number: Swift.Int + /// The name of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/name`. + public var name: Swift.String + /// The layout of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/layout`. + @frozen public enum LayoutPayload: String, Codable, Hashable, Sendable, CaseIterable { + case table = "table" + case board = "board" + case roadmap = "roadmap" + } + /// The layout of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/layout`. + public var layout: Components.Schemas.ProjectsV2View.LayoutPayload + /// The node ID of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/node_id`. + public var nodeId: Swift.String + /// The API URL of the project that contains the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/project_url`. + public var projectUrl: Swift.String + /// The web URL of the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-view/creator`. + public struct CreatorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-view/creator/value1`. + public var value1: Components.Schemas.SimpleUser + /// Creates a new `CreatorPayload`. + /// + /// - Parameters: + /// - value1: + public init(value1: Components.Schemas.SimpleUser) { + self.value1 = value1 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/projects-v2-view/creator`. + public var creator: Components.Schemas.ProjectsV2View.CreatorPayload + /// The time when the view was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/created_at`. + public var createdAt: Foundation.Date + /// The time when the view was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/updated_at`. + public var updatedAt: Foundation.Date + /// The filter query for the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/filter`. + public var filter: Swift.String? + /// The list of field IDs that are visible in the view. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/visible_fields`. + public var visibleFields: [Swift.Int] + /// - Remark: Generated from `#/components/schemas/projects-v2-view/SortByPayloadPayload`. + @frozen public enum SortByPayloadPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-view/SortByPayloadPayload/case1`. + case case1(Swift.Int) + /// - Remark: Generated from `#/components/schemas/projects-v2-view/SortByPayloadPayload/case2`. + case case2(Swift.String) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/projects-v2-view/SortByPayload`. + public typealias SortByPayloadPayload = [Components.Schemas.ProjectsV2View.SortByPayloadPayloadPayload] + /// The sorting configuration for the view. Each element is a tuple of [field_id, direction] where direction is "asc" or "desc". + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/sort_by`. + public typealias SortByPayload = [Components.Schemas.ProjectsV2View.SortByPayloadPayload] + /// The sorting configuration for the view. Each element is a tuple of [field_id, direction] where direction is "asc" or "desc". + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/sort_by`. + public var sortBy: Components.Schemas.ProjectsV2View.SortByPayload + /// The list of field IDs used for horizontal grouping. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/group_by`. + public var groupBy: [Swift.Int] + /// The list of field IDs used for vertical grouping (board layout). + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-view/vertical_group_by`. + public var verticalGroupBy: [Swift.Int] + /// Creates a new `ProjectsV2View`. + /// + /// - Parameters: + /// - id: The unique identifier of the view. + /// - number: The number of the view within the project. + /// - name: The name of the view. + /// - layout: The layout of the view. + /// - nodeId: The node ID of the view. + /// - projectUrl: The API URL of the project that contains the view. + /// - htmlUrl: The web URL of the view. + /// - creator: + /// - createdAt: The time when the view was created. + /// - updatedAt: The time when the view was last updated. + /// - filter: The filter query for the view. + /// - visibleFields: The list of field IDs that are visible in the view. + /// - sortBy: The sorting configuration for the view. Each element is a tuple of [field_id, direction] where direction is "asc" or "desc". + /// - groupBy: The list of field IDs used for horizontal grouping. + /// - verticalGroupBy: The list of field IDs used for vertical grouping (board layout). + public init( + id: Swift.Int, + number: Swift.Int, + name: Swift.String, + layout: Components.Schemas.ProjectsV2View.LayoutPayload, + nodeId: Swift.String, + projectUrl: Swift.String, + htmlUrl: Swift.String, + creator: Components.Schemas.ProjectsV2View.CreatorPayload, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + filter: Swift.String? = nil, + visibleFields: [Swift.Int], + sortBy: Components.Schemas.ProjectsV2View.SortByPayload, + groupBy: [Swift.Int], + verticalGroupBy: [Swift.Int] + ) { + self.id = id + self.number = number + self.name = name + self.layout = layout + self.nodeId = nodeId + self.projectUrl = projectUrl + self.htmlUrl = htmlUrl + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.filter = filter + self.visibleFields = visibleFields + self.sortBy = sortBy + self.groupBy = groupBy + self.verticalGroupBy = verticalGroupBy + } + public enum CodingKeys: String, CodingKey { + case id + case number + case name + case layout + case nodeId = "node_id" + case projectUrl = "project_url" + case htmlUrl = "html_url" + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case filter + case visibleFields = "visible_fields" + case sortBy = "sort_by" + case groupBy = "group_by" + case verticalGroupBy = "vertical_group_by" } } } @@ -4735,6 +5468,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/item-id`. public typealias ItemId = Swift.Int + /// The number that identifies the project view. + /// + /// - Remark: Generated from `#/components/parameters/view-number`. + public typealias ViewNumber = Swift.Int + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/components/parameters/user-id`. + public typealias UserId = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -4747,240 +5488,2347 @@ public enum Components { case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List projects for organization + /// + /// List all projects owned by a specific organization accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + public enum ProjectsListForOrg { + public static let id: Swift.String = "projects/list-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListForOrg.Input.Path, + query: Operations.ProjectsListForOrg.Input.Query = .init(), + headers: Operations.ProjectsListForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) + /// 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.ProjectsV2] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project for organization + /// + /// Get a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public enum ProjectsGetForOrg { + public static let id: Swift.String = "projects/get-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsGetForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetForOrg.Input.Path, + headers: Operations.ProjectsGetForOrg.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}/projectsV2/{project_number}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/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.ProjectsGetForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) + /// 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.ProjectsV2 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetForOrg.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.ProjectsGetForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create draft item for organization owned project + /// + /// Create draft issue item for the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)`. + public enum ProjectsCreateDraftItemForOrg { + public static let id: Swift.String = "projects/create-draft-item-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/path/org`. + public var org: Components.Parameters.Org + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - projectNumber: The project's number. + public init( + org: Components.Parameters.Org, + projectNumber: Components.Parameters.ProjectNumber + ) { + self.org = org + self.projectNumber = projectNumber + } + } + public var path: Operations.ProjectsCreateDraftItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsCreateDraftItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the draft issue item to create in the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/requestBody/json/title`. + public var title: Swift.String + /// The body content of the draft issue item to create in the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the draft issue item to create in the project. + /// - body: The body content of the draft issue item to create in the project. + public init( + title: Swift.String, + body: Swift.String? = nil + ) { + self.title = title + self.body = body + } + public enum CodingKeys: String, CodingKey { + case title + case body + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsCreateDraftItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsCreateDraftItemForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsCreateDraftItemForOrg.Input.Path, + headers: Operations.ProjectsCreateDraftItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsCreateDraftItemForOrg.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}/projectsV2/{project_number}/drafts/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/drafts/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) + /// 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.ProjectsV2ItemSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsCreateDraftItemForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsCreateDraftItemForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsCreateDraftItemForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsCreateDraftItemForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public enum ProjectsListFieldsForOrg { + public static let id: Swift.String = "projects/list-fields-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListFieldsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/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}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListFieldsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListFieldsForOrg.Input.Path, + query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForOrg.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}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/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.ProjectsListFieldsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) + /// 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.ProjectsV2Field] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListFieldsForOrg.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.ProjectsListFieldsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add a field to an organization-owned project. + /// + /// Add a field to an organization-owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)`. + public enum ProjectsAddFieldForOrg { + public static let id: Swift.String = "projects/add-field-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsAddFieldForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsAddFieldForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The ID of the IssueField to create the field for. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case1/issue_field_id`. + public var issueFieldId: Swift.Int + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - issueFieldId: The ID of the IssueField to create the field for. + public init(issueFieldId: Swift.Int) { + self.issueFieldId = issueFieldId + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.issueFieldId = try container.decode( + Swift.Int.self, + forKey: .issueFieldId + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "issue_field_id" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case1`. + case case1(Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case number = "number" + case date = "date" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/data_type`. + public var dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case2Payload.DataTypePayload + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case2Payload.DataTypePayload + ) { + self.name = name + self.dataType = dataType + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case2Payload.DataTypePayload.self, + forKey: .dataType + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case2`. + case case2(Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case2Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case singleSelect = "single_select" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/data_type`. + public var dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case3Payload.DataTypePayload + /// The options available for single select fields. At least one option must be provided when creating a single select field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/single_select_options`. + public var singleSelectOptions: [Components.Schemas.ProjectsV2FieldSingleSelectOption] + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - singleSelectOptions: The options available for single select fields. At least one option must be provided when creating a single select field. + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case3Payload.DataTypePayload, + singleSelectOptions: [Components.Schemas.ProjectsV2FieldSingleSelectOption] + ) { + self.name = name + self.dataType = dataType + self.singleSelectOptions = singleSelectOptions + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + case singleSelectOptions = "single_select_options" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case3Payload.DataTypePayload.self, + forKey: .dataType + ) + self.singleSelectOptions = try container.decode( + [Components.Schemas.ProjectsV2FieldSingleSelectOption].self, + forKey: .singleSelectOptions + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type", + "single_select_options" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case3`. + case case3(Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case3Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4`. + public struct Case4Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case iteration = "iteration" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4/data_type`. + public var dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case4Payload.DataTypePayload + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4/iteration_configuration`. + public var iterationConfiguration: Components.Schemas.ProjectsV2FieldIterationConfiguration + /// Creates a new `Case4Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - iterationConfiguration: + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case4Payload.DataTypePayload, + iterationConfiguration: Components.Schemas.ProjectsV2FieldIterationConfiguration + ) { + self.name = name + self.dataType = dataType + self.iterationConfiguration = iterationConfiguration + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + case iterationConfiguration = "iteration_configuration" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case4Payload.DataTypePayload.self, + forKey: .dataType + ) + self.iterationConfiguration = try container.decode( + Components.Schemas.ProjectsV2FieldIterationConfiguration.self, + forKey: .iterationConfiguration + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type", + "iteration_configuration" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/json/case4`. + case case4(Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload.Case4Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case4(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) + case let .case4(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddFieldForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddFieldForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsAddFieldForOrg.Input.Path, + headers: Operations.ProjectsAddFieldForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddFieldForOrg.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}/projectsV2/{project_number}/fields/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) + /// 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.ProjectsV2Field { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsAddFieldForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsAddFieldForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response for adding a field to an organization-owned project. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddFieldForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddFieldForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/post(projects/add-field-for-org)/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 project field for organization + /// + /// Get a specific field for an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public enum ProjectsGetFieldForOrg { + public static let id: Swift.String = "projects/get-field-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - fieldId: The unique identifier of the field. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + fieldId: Components.Parameters.FieldId, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.fieldId = fieldId + self.org = org + } + } + public var path: Operations.ProjectsGetFieldForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetFieldForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetFieldForOrg.Input.Path, + headers: Operations.ProjectsGetFieldForOrg.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}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_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.ProjectsGetFieldForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) + /// 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.ProjectsV2Field { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetFieldForOrg.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.ProjectsGetFieldForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public enum ProjectsListItemsForOrg { + public static let id: Swift.String = "projects/list-items-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListItemsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.fields = fields + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListItemsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + public var headers: Operations.ProjectsListItemsForOrg.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListItemsForOrg.Input.Path, + query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - public struct ValidationFailed: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. - case json(Components.Schemas.ValidationError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationError { - get throws { - switch self { - case let .json(body): - return body + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/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.ProjectsListItemsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// 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.ProjectsV2ItemWithContent] { + get throws { + switch self { + case let .json(body): + return body + } } } } + /// Received HTTP response body + public var body: Operations.ProjectsListItemsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailed.Body - /// Creates a new `ValidationFailed`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailed.Body) { - self.body = body + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForOrg.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.ProjectsListItemsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} - } - public struct RequiresAuthentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.RequiresAuthentication.Body - /// Creates a new `RequiresAuthentication`. + /// Forbidden /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.RequiresAuthentication.Body) { - self.body = body + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias Link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List projects for organization + /// Add item to organization owned project /// - /// List all projects owned by a specific organization accessible by the authenticated user. + /// Add an issue or pull request item to the specified organization owned project. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. - public enum ProjectsListForOrg { - public static let id: Swift.String = "projects/list-for-org" + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public enum ProjectsAddItemForOrg { + public static let id: Swift.String = "projects/add-item-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/org`. public var org: Components.Parameters.Org + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ProjectsListForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to projects of the specified type. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/q`. - public var q: Swift.String? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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}/projectsV2/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - q: Limit results to projects of the specified type. - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - 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)." + /// - projectNumber: The project's number. public init( - q: Swift.String? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil + org: Components.Parameters.Org, + projectNumber: Components.Parameters.ProjectNumber ) { - self.q = q - self.before = before - self.after = after - self.perPage = perPage + self.org = org + self.projectNumber = projectNumber } } - public var query: Operations.ProjectsListForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/header`. + public var path: Operations.ProjectsAddItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/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.ProjectsListForOrg.Input.Headers + public var headers: Operations.ProjectsAddItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// Creates a new `Case1Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/case1`. + case case1(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Creates a new `Case2Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/case2`. + case case2(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListForOrg.Input.Path, - query: Operations.ProjectsListForOrg.Input.Query = .init(), - headers: Operations.ProjectsListForOrg.Input.Headers = .init() + path: Operations.ProjectsAddItemForOrg.Input.Path, + headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddItemForOrg.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}/projectsV2/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2]) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// 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.ProjectsV2] { + public var json: Components.Schemas.ProjectsV2ItemSimple { get throws { switch self { case let .json(body): @@ -4990,38 +7838,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsAddItemForOrg.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsAddItemForOrg.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForOrg.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -5029,13 +7872,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -5060,7 +7903,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5083,7 +7926,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5135,69 +7978,131 @@ public enum Operations { } } } - /// Get project for organization + /// Get an item for an organization owned project /// - /// Get a specific organization-owned project. + /// Get a specific item from an organization-owned project. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. - public enum ProjectsGetForOrg { - public static let id: Swift.String = "projects/get-for-org" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public enum ProjectsGetOrgItem { + public static let id: Swift.String = "projects/get-org-item" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber - /// The organization name. The name is not case sensitive. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsGetOrgItem.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: fields[]=123&fields[]=456&fields[]=789 or fields=123,456,789 /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? + /// Creates a new `Query`. /// /// - Parameters: - /// - projectNumber: The project's number. - /// - org: The organization name. The name is not case sensitive. - public init( - projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org - ) { - self.projectNumber = projectNumber - self.org = org + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? = nil) { + self.fields = fields } } - public var path: Operations.ProjectsGetForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/header`. + public var query: Operations.ProjectsGetOrgItem.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_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.ProjectsGetForOrg.Input.Headers + public var headers: Operations.ProjectsGetOrgItem.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetForOrg.Input.Path, - headers: Operations.ProjectsGetForOrg.Input.Headers = .init() + path: Operations.ProjectsGetOrgItem.Input.Path, + query: Operations.ProjectsGetOrgItem.Input.Query = .init(), + headers: Operations.ProjectsGetOrgItem.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}/projectsV2/{project_number}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -5208,16 +8113,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content`. + public var headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// 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.ProjectsV2 { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -5227,15 +8132,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetForOrg.Output.Ok.Body + public var body: Operations.ProjectsGetOrgItem.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetForOrg.Output.Ok.Body + headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetOrgItem.Output.Ok.Body ) { self.headers = headers self.body = body @@ -5243,15 +8148,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetForOrg.Output.Ok) + case ok(Operations.ProjectsGetOrgItem.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.ProjectsGetForOrg.Output.Ok { + public var ok: Operations.ProjectsGetOrgItem.Output.Ok { get throws { switch self { case let .ok(response): @@ -5266,13 +8171,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -5297,7 +8202,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5320,7 +8225,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5372,123 +8277,182 @@ public enum Operations { } } } - /// List project fields for organization + /// Update project item for organization /// - /// List all fields for a specific organization-owned project. + /// Update a specific item in an organization-owned project. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. - public enum ProjectsListFieldsForOrg { - public static let id: Swift.String = "projects/list-fields-for-org" + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public enum ProjectsUpdateItemForOrg { + public static let id: Swift.String = "projects/update-item-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/project_number`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber self.org = org + self.itemId = itemId } } - public var path: Operations.ProjectsListFieldsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/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}/projectsV2/{project_number}/fields/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after - } - } - public var query: Operations.ProjectsListFieldsForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/header`. + public var path: Operations.ProjectsUpdateItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_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.ProjectsListFieldsForOrg.Input.Headers + public var headers: Operations.ProjectsUpdateItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListFieldsForOrg.Input.Path, - query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), - headers: Operations.ProjectsListFieldsForOrg.Input.Headers = .init() + path: Operations.ProjectsUpdateItemForOrg.Input.Path, + headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForOrg.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}/projectsV2/{project_number}/fields/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/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.ProjectsListFieldsForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2Field]) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// 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.ProjectsV2Field] { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -5498,31 +8462,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + public var body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListFieldsForOrg.Output.Ok) + case ok(Operations.ProjectsUpdateItemForOrg.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.ProjectsListFieldsForOrg.Output.Ok { + public var ok: Operations.ProjectsUpdateItemForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -5535,32 +8494,24 @@ public enum Operations { } } } - /// Not modified - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/401`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .notModified(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "unauthorized", response: self ) } @@ -5568,7 +8519,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5589,24 +8540,47 @@ public enum Operations { } } } - /// Requires authentication + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/404`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// 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 `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unauthorized(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/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 ) } @@ -5643,168 +8617,102 @@ public enum Operations { } } } - /// Get project field for organization + /// Delete project item for organization /// - /// Get a specific field for an organization-owned project. + /// Delete a specific item from an organization-owned project. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. - public enum ProjectsGetFieldForOrg { - public static let id: Swift.String = "projects/get-field-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public enum ProjectsDeleteItemForOrg { + public static let id: Swift.String = "projects/delete-item-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the field. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. - public var fieldId: Components.Parameters.FieldId /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - fieldId: The unique identifier of the field. /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - fieldId: Components.Parameters.FieldId, - org: Components.Parameters.Org + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber - self.fieldId = fieldId self.org = org + self.itemId = itemId } } - public var path: Operations.ProjectsGetFieldForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public var path: Operations.ProjectsDeleteItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_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.ProjectsGetFieldForOrg.Input.Headers + public var headers: Operations.ProjectsDeleteItemForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ProjectsGetFieldForOrg.Input.Path, - headers: Operations.ProjectsGetFieldForOrg.Input.Headers = .init() + path: Operations.ProjectsDeleteItemForOrg.Input.Path, + headers: Operations.ProjectsDeleteItemForOrg.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}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_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.ProjectsGetFieldForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2Field) - /// 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.ProjectsV2Field { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetFieldForOrg.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.ProjectsGetFieldForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForOrg.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForOrg.Output.NoContent { get throws { switch self { - case let .notModified(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "noContent", response: self ) } @@ -5812,7 +8720,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5835,7 +8743,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5887,174 +8795,161 @@ public enum Operations { } } } - /// List items for an organization owned project + /// Create a view for an organization-owned project /// - /// List all items for a specific organization-owned project accessible by the authenticated user. + /// Create a new view in an organization-owned project. Views allow you to customize how items in a project are displayed and filtered. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. - public enum ProjectsListItemsForOrg { - public static let id: Swift.String = "projects/list-items-for-org" + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)`. + public enum ProjectsCreateViewForOrg { + public static let id: Swift.String = "projects/create-view-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/path`. public struct Path: Sendable, Hashable { - /// The project's number. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/path/org`. public var org: Components.Parameters.Org + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// Creates a new `Path`. /// /// - Parameters: - /// - projectNumber: The project's number. /// - org: The organization name. The name is not case sensitive. + /// - projectNumber: The project's number. public init( - projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org + org: Components.Parameters.Org, + projectNumber: Components.Parameters.ProjectNumber ) { - self.projectNumber = projectNumber self.org = org + self.projectNumber = projectNumber } } - public var path: Operations.ProjectsListItemsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query`. - public struct Query: Sendable, Hashable { - /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/q`. - public var q: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. - @frozen public enum FieldsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. - public var fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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}/projectsV2/{project_number}/items/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - q: Swift.String? = nil, - fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.q = q - self.fields = fields - self.before = before - self.after = after - self.perPage = perPage - } - } - public var query: Operations.ProjectsListItemsForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/header`. + public var path: Operations.ProjectsCreateViewForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/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.ProjectsListItemsForOrg.Input.Headers + public var headers: Operations.ProjectsCreateViewForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the view. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json/name`. + public var name: Swift.String + /// The layout of the view. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json/layout`. + @frozen public enum LayoutPayload: String, Codable, Hashable, Sendable, CaseIterable { + case table = "table" + case board = "board" + case roadmap = "roadmap" + } + /// The layout of the view. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json/layout`. + public var layout: Operations.ProjectsCreateViewForOrg.Input.Body.JsonPayload.LayoutPayload + /// The filter query for the view. See [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json/filter`. + public var filter: Swift.String? + /// `visible_fields` is not applicable to `roadmap` layout views. + /// For `table` and `board` layouts, this represents the field IDs that should be visible in the view. If not provided, the default visible fields will be used. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/json/visible_fields`. + public var visibleFields: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the view. + /// - layout: The layout of the view. + /// - filter: The filter query for the view. See [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - visibleFields: `visible_fields` is not applicable to `roadmap` layout views. + public init( + name: Swift.String, + layout: Operations.ProjectsCreateViewForOrg.Input.Body.JsonPayload.LayoutPayload, + filter: Swift.String? = nil, + visibleFields: [Swift.Int]? = nil + ) { + self.name = name + self.layout = layout + self.filter = filter + self.visibleFields = visibleFields + } + public enum CodingKeys: String, CodingKey { + case name + case layout + case filter + case visibleFields = "visible_fields" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.layout = try container.decode( + Operations.ProjectsCreateViewForOrg.Input.Body.JsonPayload.LayoutPayload.self, + forKey: .layout + ) + self.filter = try container.decodeIfPresent( + Swift.String.self, + forKey: .filter + ) + self.visibleFields = try container.decodeIfPresent( + [Swift.Int].self, + forKey: .visibleFields + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "layout", + "filter", + "visible_fields" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsCreateViewForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsCreateViewForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListItemsForOrg.Input.Path, - query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), - headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() + path: Operations.ProjectsCreateViewForOrg.Input.Path, + headers: Operations.ProjectsCreateViewForOrg.Input.Headers = .init(), + body: Operations.ProjectsCreateViewForOrg.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}/projectsV2/{project_number}/items/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/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.ProjectsListItemsForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2View) /// 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.ProjectsV2ItemWithContent] { + public var json: Components.Schemas.ProjectsV2View { get throws { switch self { case let .json(body): @@ -6064,38 +8959,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListItemsForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsCreateViewForOrg.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsListItemsForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsCreateViewForOrg.Output.Created.Body) { self.body = body } } - /// Response + /// Response for creating a view in an organization-owned project. /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListItemsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsCreateViewForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListItemsForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsCreateViewForOrg.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -6103,76 +8993,173 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { .notModified(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Resource not found /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .notModified(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "notFound", response: self ) } } } - /// Forbidden + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/422`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// 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 `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .forbidden(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Requires authentication + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/POST/responses/503/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsCreateViewForOrg.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsCreateViewForOrg.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/post(projects/create-view-for-org)/responses/503`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ProjectsCreateViewForOrg.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ProjectsCreateViewForOrg.Output.ServiceUnavailable { get throws { switch self { - case let .unauthorized(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "serviceUnavailable", response: self ) } @@ -6209,118 +9196,175 @@ public enum Operations { } } } - /// Add item to organization owned project + /// List items for an organization project view /// - /// Add an issue or pull request item to the specified organization owned project. + /// List items in an organization project with the saved view's filter applied. /// - /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. - public enum ProjectsAddItemForOrg { - public static let id: Swift.String = "projects/add-item-for-org" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)`. + public enum ProjectsListViewItemsForOrg { + public static let id: Swift.String = "projects/list-view-items-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/path`. public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/path/org`. public var org: Components.Parameters.Org - /// The project's number. + /// The number that identifies the project view. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/path/view_number`. + public var viewNumber: Components.Parameters.ViewNumber /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - viewNumber: The number that identifies the project view. public init( + projectNumber: Components.Parameters.ProjectNumber, org: Components.Parameters.Org, - projectNumber: Components.Parameters.ProjectNumber + viewNumber: Components.Parameters.ViewNumber ) { - self.org = org self.projectNumber = projectNumber + self.org = org + self.viewNumber = viewNumber } } - public var path: Operations.ProjectsAddItemForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/header`. + public var path: Operations.ProjectsListViewItemsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the + /// title field will be returned. + /// + /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields`. + public var fields: Operations.ProjectsListViewItemsForOrg.Input.Query.FieldsPayload? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// 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}/projectsV2/{project_number}/views/{view_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + fields: Operations.ProjectsListViewItemsForOrg.Input.Query.FieldsPayload? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.fields = fields + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListViewItemsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/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.ProjectsAddItemForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case issue = "Issue" - case pullRequest = "PullRequest" - } - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - public var _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload - /// The numeric ID of the issue or pull request to add to the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/id`. - public var id: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. - /// - id: The numeric ID of the issue or pull request to add to the project. - public init( - _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload, - id: Swift.Int - ) { - self._type = _type - self.id = id - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case id - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsAddItemForOrg.Input.Body + public var headers: Operations.ProjectsListViewItemsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsAddItemForOrg.Input.Path, - headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), - body: Operations.ProjectsAddItemForOrg.Input.Body + path: Operations.ProjectsListViewItemsForOrg.Input.Path, + query: Operations.ProjectsListViewItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListViewItemsForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/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.ProjectsListViewItemsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemSimple) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) /// 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.ProjectsV2ItemSimple { + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { get throws { switch self { case let .json(body): @@ -6330,33 +9374,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsAddItemForOrg.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsListViewItemsForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsAddItemForOrg.Output.Created.Body) { + public init( + headers: Operations.ProjectsListViewItemsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListViewItemsForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsAddItemForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListViewItemsForOrg.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.ProjectsAddItemForOrg.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListViewItemsForOrg.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 ) } @@ -6364,13 +9413,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -6395,7 +9444,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6418,7 +9467,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6439,6 +9488,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -6470,151 +9542,111 @@ public enum Operations { } } } - /// Get an item for an organization owned project + /// Create draft item for user owned project /// - /// Get a specific item from an organization-owned project. + /// Create draft issue item for the specified user owned project. /// - /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. - public enum ProjectsGetOrgItem { - public static let id: Swift.String = "projects/get-org-item" + /// - Remark: HTTP `POST /user/{user_id}/projectsV2/{project_number}/drafts`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)`. + public enum ProjectsCreateDraftItemForAuthenticatedUser { + public static let id: Swift.String = "projects/create-draft-item-for-authenticated-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path`. + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/path`. public struct Path: Sendable, Hashable { + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/path/user_id`. + public var userId: Components.Parameters.UserId /// The project's number. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the project item. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. - public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - userId: The unique identifier of the user. /// - projectNumber: The project's number. - /// - org: The organization name. The name is not case sensitive. - /// - itemId: The unique identifier of the project item. public init( - projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org, - itemId: Components.Parameters.ItemId + userId: Components.Parameters.UserId, + projectNumber: Components.Parameters.ProjectNumber ) { + self.userId = userId self.projectNumber = projectNumber - self.org = org - self.itemId = itemId - } - } - public var path: Operations.ProjectsGetOrgItem.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. - @frozen public enum FieldsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// Example: fields[]=123&fields[]=456&fields[]=789 or fields=123,456,789 - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. - public var fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - public init(fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? = nil) { - self.fields = fields } } - public var query: Operations.ProjectsGetOrgItem.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/header`. + public var path: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Path + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/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.ProjectsGetOrgItem.Input.Headers + public var headers: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Headers + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the draft issue item to create in the project. + /// + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/requestBody/json/title`. + public var title: Swift.String + /// The body content of the draft issue item to create in the project. + /// + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the draft issue item to create in the project. + /// - body: The body content of the draft issue item to create in the project. + public init( + title: Swift.String, + body: Swift.String? = nil + ) { + self.title = title + self.body = body + } + public enum CodingKeys: String, CodingKey { + case title + case body + } + } + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsGetOrgItem.Input.Path, - query: Operations.ProjectsGetOrgItem.Input.Query = .init(), - headers: Operations.ProjectsGetOrgItem.Input.Headers = .init() + path: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Path, + headers: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.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}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_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.ProjectsGetOrgItem.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemWithContent) + /// - Remark: Generated from `#/paths/user/{user_id}/projectsV2/{project_number}/drafts/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// 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.ProjectsV2ItemWithContent { + public var json: Components.Schemas.ProjectsV2ItemSimple { get throws { switch self { case let .json(body): @@ -6624,38 +9656,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetOrgItem.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetOrgItem.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/200`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetOrgItem.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetOrgItem.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsCreateDraftItemForAuthenticatedUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -6663,13 +9690,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -6694,7 +9721,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/403`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6717,7 +9744,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/401`. + /// - Remark: Generated from `#/paths//user/{user_id}/projectsV2/{project_number}/drafts/post(projects/create-draft-item-for-authenticated-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6769,155 +9796,134 @@ public enum Operations { } } } - /// Update project item for organization + /// Create a view for a user-owned project /// - /// Update a specific item in an organization-owned project. + /// Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered. /// - /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. - public enum ProjectsUpdateItemForOrg { - public static let id: Swift.String = "projects/update-item-for-org" + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/views`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)`. + public enum ProjectsCreateViewForUser { + public static let id: Swift.String = "projects/create-view-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/path`. public struct Path: Sendable, Hashable { + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/path/user_id`. + public var userId: Components.Parameters.UserId /// The project's number. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the project item. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. - public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - userId: The unique identifier of the user. /// - projectNumber: The project's number. - /// - org: The organization name. The name is not case sensitive. - /// - itemId: The unique identifier of the project item. public init( - projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org, - itemId: Components.Parameters.ItemId + userId: Components.Parameters.UserId, + projectNumber: Components.Parameters.ProjectNumber ) { + self.userId = userId self.projectNumber = projectNumber - self.org = org - self.itemId = itemId } } - public var path: Operations.ProjectsUpdateItemForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. + public var path: Operations.ProjectsCreateViewForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/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.ProjectsUpdateItemForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + public var headers: Operations.ProjectsCreateViewForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. - public struct FieldsPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the project field to update. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. - public var id: Swift.Int - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. - case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - public var value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? - /// Creates a new `FieldsPayloadPayload`. - /// - /// - Parameters: - /// - id: The ID of the project field to update. - /// - value: The new value for the field: - public init( - id: Swift.Int, - value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil - ) { - self.id = id - self.value = value - } - public enum CodingKeys: String, CodingKey { - case id - case value - } + /// The name of the view. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json/name`. + public var name: Swift.String + /// The layout of the view. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json/layout`. + @frozen public enum LayoutPayload: String, Codable, Hashable, Sendable, CaseIterable { + case table = "table" + case board = "board" + case roadmap = "roadmap" } - /// A list of field updates to apply. + /// The layout of the view. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public typealias FieldsPayload = [Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload] - /// A list of field updates to apply. + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json/layout`. + public var layout: Operations.ProjectsCreateViewForUser.Input.Body.JsonPayload.LayoutPayload + /// The filter query for the view. See [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public var fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json/filter`. + public var filter: Swift.String? + /// `visible_fields` is not applicable to `roadmap` layout views. + /// For `table` and `board` layouts, this represents the field IDs that should be visible in the view. If not provided, the default visible fields will be used. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/json/visible_fields`. + public var visibleFields: [Swift.Int]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - fields: A list of field updates to apply. - public init(fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload) { - self.fields = fields + /// - name: The name of the view. + /// - layout: The layout of the view. + /// - filter: The filter query for the view. See [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - visibleFields: `visible_fields` is not applicable to `roadmap` layout views. + public init( + name: Swift.String, + layout: Operations.ProjectsCreateViewForUser.Input.Body.JsonPayload.LayoutPayload, + filter: Swift.String? = nil, + visibleFields: [Swift.Int]? = nil + ) { + self.name = name + self.layout = layout + self.filter = filter + self.visibleFields = visibleFields } public enum CodingKeys: String, CodingKey { - case fields + case name + case layout + case filter + case visibleFields = "visible_fields" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.layout = try container.decode( + Operations.ProjectsCreateViewForUser.Input.Body.JsonPayload.LayoutPayload.self, + forKey: .layout + ) + self.filter = try container.decodeIfPresent( + Swift.String.self, + forKey: .filter + ) + self.visibleFields = try container.decodeIfPresent( + [Swift.Int].self, + forKey: .visibleFields + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "layout", + "filter", + "visible_fields" + ]) } } - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsCreateViewForUser.Input.Body.JsonPayload) } - public var body: Operations.ProjectsUpdateItemForOrg.Input.Body + public var body: Operations.ProjectsCreateViewForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -6925,9 +9931,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ProjectsUpdateItemForOrg.Input.Path, - headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), - body: Operations.ProjectsUpdateItemForOrg.Input.Body + path: Operations.ProjectsCreateViewForUser.Input.Path, + headers: Operations.ProjectsCreateViewForUser.Input.Headers = .init(), + body: Operations.ProjectsCreateViewForUser.Input.Body ) { self.path = path self.headers = headers @@ -6935,16 +9941,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemWithContent) + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2View) /// 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.ProjectsV2ItemWithContent { + public var json: Components.Schemas.ProjectsV2View { get throws { switch self { case let .json(body): @@ -6954,56 +9960,64 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsCreateViewForUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body) { + public init(body: Operations.ProjectsCreateViewForUser.Output.Created.Body) { self.body = body } } - /// Response + /// Response for creating a view in a user-owned project. /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateItemForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsCreateViewForUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsUpdateItemForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsCreateViewForUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } - /// Requires authentication + /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/304`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .unauthorized(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notModified", response: self ) } @@ -7011,7 +10025,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7032,9 +10046,32 @@ public enum Operations { } } } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/404`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -7057,7 +10094,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/422`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -7078,6 +10115,57 @@ public enum Operations { } } } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/views/POST/responses/503/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsCreateViewForUser.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsCreateViewForUser.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/views/post(projects/create-view-for-user)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ProjectsCreateViewForUser.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ProjectsCreateViewForUser.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -7109,102 +10197,193 @@ public enum Operations { } } } - /// Delete project item for organization + /// List projects for user /// - /// Delete a specific item from an organization-owned project. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. - public enum ProjectsDeleteItemForOrg { - public static let id: Swift.String = "projects/delete-item-for-org" + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public enum ProjectsListForUser { + public static let id: Swift.String = "projects/list-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. public struct Path: Sendable, Hashable { - /// The project's number. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber - /// The organization name. The name is not case sensitive. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the project item. + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. /// - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. - public var itemId: Components.Parameters.ItemId - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) + /// 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.ProjectsV2] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListForUser.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - projectNumber: The project's number. - /// - org: The organization name. The name is not case sensitive. - /// - itemId: The unique identifier of the project item. + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body public init( - projectNumber: Components.Parameters.ProjectNumber, - org: Components.Parameters.Org, - itemId: Components.Parameters.ItemId + headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForUser.Output.Ok.Body ) { - self.projectNumber = projectNumber - self.org = org - self.itemId = itemId - } - } - public var path: Operations.ProjectsDeleteItemForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_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 + self.headers = headers + self.body = body } } - public var headers: Operations.ProjectsDeleteItemForOrg.Input.Headers - /// Creates a new `Input`. + /// Response /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDeleteItemForOrg.Input.Path, - headers: Operations.ProjectsDeleteItemForOrg.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() {} + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// Response + /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteItemForOrg.Output.NoContent) - /// Response + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) } - /// The associated value of the enum case if `self` is `.noContent`. + /// The associated value of the enum case if `self` is `.notModified`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteItemForOrg.Output.NoContent { + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .noContent(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notModified", response: self ) } @@ -7212,7 +10391,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7235,7 +10414,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7287,101 +10466,69 @@ public enum Operations { } } } - /// List projects for user + /// Get project for user /// - /// List all projects owned by a specific user accessible by the authenticated user. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public enum ProjectsListForUser { - public static let id: Swift.String = "projects/list-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public enum ProjectsGetForUser { + public static let id: Swift.String = "projects/get-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path`. public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username - } - } - public var path: Operations.ProjectsListForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to projects of the specified type. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. - public var q: Swift.String? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - q: Limit results to projects of the specified type. - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - q: Swift.String? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username ) { - self.q = q - self.before = before - self.after = after - self.perPage = perPage + self.projectNumber = projectNumber + self.username = username } } - public var query: Operations.ProjectsListForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. + public var path: Operations.ProjectsGetForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/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.ProjectsListForUser.Input.Headers + public var headers: Operations.ProjectsGetForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7392,16 +10539,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. + public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) /// 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.ProjectsV2] { + public var json: Components.Schemas.ProjectsV2 { get throws { switch self { case let .json(body): @@ -7411,15 +10558,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListForUser.Output.Ok.Body + public var body: Operations.ProjectsGetForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForUser.Output.Ok.Body + headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7427,15 +10574,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForUser.Output.Ok) + case ok(Operations.ProjectsGetForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForUser.Output.Ok { + public var ok: Operations.ProjectsGetForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7450,13 +10597,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7481,7 +10628,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7504,7 +10651,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7556,69 +10703,103 @@ public enum Operations { } } } - /// Get project for user + /// List project fields for user /// - /// Get a specific user-owned project. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. - public enum ProjectsGetForUser { - public static let id: Swift.String = "projects/get-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public enum ProjectsListFieldsForUser { + public static let id: Swift.String = "projects/list-fields-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber - /// The handle for the GitHub user account. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. + public init( + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username + ) { + self.projectNumber = projectNumber + self.username = username + } + } + public var path: Operations.ProjectsListFieldsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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/users/{username}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. /// /// - Parameters: - /// - projectNumber: The project's number. - /// - username: The handle for the GitHub user account. + /// - 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)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - projectNumber: Components.Parameters.ProjectNumber, - username: Components.Parameters.Username + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil ) { - self.projectNumber = projectNumber - self.username = username + self.perPage = perPage + self.before = before + self.after = after } } - public var path: Operations.ProjectsGetForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/header`. + public var query: Operations.ProjectsListFieldsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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.ProjectsGetForUser.Input.Headers + public var headers: Operations.ProjectsListFieldsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetForUser.Input.Path, - headers: Operations.ProjectsGetForUser.Input.Headers = .init() + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7629,16 +10810,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content`. + public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) /// 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.ProjectsV2 { + public var json: [Components.Schemas.ProjectsV2Field] { get throws { switch self { case let .json(body): @@ -7648,15 +10829,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetForUser.Output.Ok.Body + public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetForUser.Output.Ok.Body + headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7664,15 +10845,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetForUser.Output.Ok) + case ok(Operations.ProjectsListFieldsForUser.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.ProjectsGetForUser.Output.Ok { + public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7687,13 +10868,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7718,7 +10899,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7741,7 +10922,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7793,123 +10974,299 @@ public enum Operations { } } } - /// List project fields for user + /// Add field to user owned project /// - /// List all fields for a specific user-owned project. + /// Add a field to a specified user owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. - public enum ProjectsListFieldsForUser { - public static let id: Swift.String = "projects/list-fields-for-user" + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)`. + public enum ProjectsAddFieldForUser { + public static let id: Swift.String = "projects/add-field-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/path`. public struct Path: Sendable, Hashable { - /// The project's number. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/path/username`. public var username: Components.Parameters.Username + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// Creates a new `Path`. /// /// - Parameters: - /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. + /// - projectNumber: The project's number. public init( - projectNumber: Components.Parameters.ProjectNumber, - username: Components.Parameters.Username + username: Components.Parameters.Username, + projectNumber: Components.Parameters.ProjectNumber ) { - self.projectNumber = projectNumber self.username = username + self.projectNumber = projectNumber } } - public var path: Operations.ProjectsListFieldsForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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/users/{username}/projectsV2/{project_number}/fields/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// 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)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after - } - } - public var query: Operations.ProjectsListFieldsForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/header`. + public var path: Operations.ProjectsAddFieldForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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.ProjectsListFieldsForUser.Input.Headers + public var headers: Operations.ProjectsAddFieldForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case1/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case1/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case number = "number" + case date = "date" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case1/data_type`. + public var dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case1Payload.DataTypePayload + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case1Payload.DataTypePayload + ) { + self.name = name + self.dataType = dataType + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case1Payload.DataTypePayload.self, + forKey: .dataType + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type" + ]) + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case1`. + case case1(Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case singleSelect = "single_select" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/data_type`. + public var dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case2Payload.DataTypePayload + /// The options available for single select fields. At least one option must be provided when creating a single select field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2/single_select_options`. + public var singleSelectOptions: [Components.Schemas.ProjectsV2FieldSingleSelectOption] + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - singleSelectOptions: The options available for single select fields. At least one option must be provided when creating a single select field. + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case2Payload.DataTypePayload, + singleSelectOptions: [Components.Schemas.ProjectsV2FieldSingleSelectOption] + ) { + self.name = name + self.dataType = dataType + self.singleSelectOptions = singleSelectOptions + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + case singleSelectOptions = "single_select_options" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case2Payload.DataTypePayload.self, + forKey: .dataType + ) + self.singleSelectOptions = try container.decode( + [Components.Schemas.ProjectsV2FieldSingleSelectOption].self, + forKey: .singleSelectOptions + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type", + "single_select_options" + ]) + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case2`. + case case2(Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case2Payload) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// The name of the field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case iteration = "iteration" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/data_type`. + public var dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case3Payload.DataTypePayload + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3/iteration_configuration`. + public var iterationConfiguration: Components.Schemas.ProjectsV2FieldIterationConfiguration + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - iterationConfiguration: + public init( + name: Swift.String, + dataType: Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case3Payload.DataTypePayload, + iterationConfiguration: Components.Schemas.ProjectsV2FieldIterationConfiguration + ) { + self.name = name + self.dataType = dataType + self.iterationConfiguration = iterationConfiguration + } + public enum CodingKeys: String, CodingKey { + case name + case dataType = "data_type" + case iterationConfiguration = "iteration_configuration" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.dataType = try container.decode( + Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case3Payload.DataTypePayload.self, + forKey: .dataType + ) + self.iterationConfiguration = try container.decode( + Components.Schemas.ProjectsV2FieldIterationConfiguration.self, + forKey: .iterationConfiguration + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "data_type", + "iteration_configuration" + ]) + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/json/case3`. + case case3(Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddFieldForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddFieldForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListFieldsForUser.Input.Path, - query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), - headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + path: Operations.ProjectsAddFieldForUser.Input.Path, + headers: Operations.ProjectsAddFieldForUser.Input.Headers = .init(), + body: Operations.ProjectsAddFieldForUser.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/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/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.ProjectsListFieldsForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2Field]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) /// 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.ProjectsV2Field] { + public var json: Components.Schemas.ProjectsV2Field { get throws { switch self { case let .json(body): @@ -7919,38 +11276,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsAddFieldForUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListFieldsForUser.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsAddFieldForUser.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListFieldsForUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddFieldForUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddFieldForUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -7958,13 +11310,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7989,7 +11341,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8012,7 +11364,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8033,6 +11385,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/post(projects/add-field-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -8365,8 +11740,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -8385,7 +11760,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -8678,37 +12053,48 @@ public enum Operations { /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case issue = "Issue" - case pullRequest = "PullRequest" - } - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload - /// The numeric ID of the issue or pull request to add to the project. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/id`. - public var id: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. - /// - id: The numeric ID of the issue or pull request to add to the project. - public init( - _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, - id: Swift.Int - ) { - self._type = _type - self.id = id + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// Creates a new `Case1Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/case1`. + case case1(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Creates a new `Case2Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/case2`. + case case2(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case id + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } } } /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. @@ -8939,8 +12325,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case2`. case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -8959,7 +12345,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -9263,8 +12649,8 @@ public enum Operations { case case1(Swift.String) /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] do { self = .case1(try decoder.decodeFromSingleValueContainer()) return @@ -9283,7 +12669,7 @@ public enum Operations { errors: errors ) } - public func encode(to encoder: any Encoder) throws { + public func encode(to encoder: any Swift.Encoder) throws { switch self { case let .case1(value): try encoder.encodeToSingleValueContainer(value) @@ -9415,16 +12801,217 @@ public enum Operations { case unauthorized(Components.Responses.RequiresAuthentication) /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete project item for user + /// + /// Delete a specific item from a user-owned project. + /// + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public enum ProjectsDeleteItemForUser { + public static let id: Swift.String = "projects/delete-item-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId + } + } + public var path: Operations.ProjectsDeleteItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/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.ProjectsDeleteItemForUser.Output.NoContent { get throws { switch self { - case let .unauthorized(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "noContent", response: self ) } @@ -9432,7 +13019,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9453,47 +13040,24 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } @@ -9530,102 +13094,247 @@ public enum Operations { } } } - /// Delete project item for user + /// List items for a user project view /// - /// Delete a specific item from a user-owned project. + /// List items in a user project with the saved view's filter applied. /// - /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. - public enum ProjectsDeleteItemForUser { - public static let id: Swift.String = "projects/delete-item-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/views/{view_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)`. + public enum ProjectsListViewItemsForUser { + public static let id: Swift.String = "projects/list-view-items-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/path/username`. public var username: Components.Parameters.Username - /// The unique identifier of the project item. + /// The number that identifies the project view. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. - public var itemId: Components.Parameters.ItemId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/path/view_number`. + public var viewNumber: Components.Parameters.ViewNumber /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. - /// - itemId: The unique identifier of the project item. + /// - viewNumber: The number that identifies the project view. public init( projectNumber: Components.Parameters.ProjectNumber, username: Components.Parameters.Username, - itemId: Components.Parameters.ItemId + viewNumber: Components.Parameters.ViewNumber ) { self.projectNumber = projectNumber self.username = username - self.itemId = itemId + self.viewNumber = viewNumber } } - public var path: Operations.ProjectsDeleteItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public var path: Operations.ProjectsListViewItemsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the + /// title field will be returned. + /// + /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/fields`. + public var fields: Operations.ProjectsListViewItemsForUser.Input.Query.FieldsPayload? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + fields: Operations.ProjectsListViewItemsForUser.Input.Query.FieldsPayload? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.fields = fields + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListViewItemsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/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.ProjectsDeleteItemForUser.Input.Headers + public var headers: Operations.ProjectsListViewItemsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsDeleteItemForUser.Input.Path, - headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + path: Operations.ProjectsListViewItemsForUser.Input.Path, + query: Operations.ProjectsListViewItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListViewItemsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/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.ProjectsListViewItemsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/views/{view_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// 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.ProjectsV2ItemWithContent] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListViewItemsForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListViewItemsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListViewItemsForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) - /// Response + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListViewItemsForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListViewItemsForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) } - /// The associated value of the enum case if `self` is `.noContent`. + /// The associated value of the enum case if `self` is `.notModified`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .noContent(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notModified", response: self ) } @@ -9633,7 +13342,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9656,7 +13365,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -9677,6 +13386,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/views/{view_number}/items/get(projects/list-view-items-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document.