diff --git a/.spi.yml b/.spi.yml index 999ac4d663f..da14fbf11a0 100644 --- a/.spi.yml +++ b/.spi.yml @@ -10,6 +10,7 @@ builder: - GitHubRestAPICampaigns - GitHubRestAPIChecks - GitHubRestAPIClassroom + - GitHubRestAPICode_Quality - GitHubRestAPICode_Scanning - GitHubRestAPICode_Security - GitHubRestAPICodes_Of_Conduct diff --git a/Package.swift b/Package.swift index 37131ac882a..be30c92ff4f 100644 --- a/Package.swift +++ b/Package.swift @@ -19,6 +19,7 @@ let package = Package( .library(name: "GitHubRestAPICampaigns", targets: ["GitHubRestAPICampaigns"]), .library(name: "GitHubRestAPIChecks", targets: ["GitHubRestAPIChecks"]), .library(name: "GitHubRestAPIClassroom", targets: ["GitHubRestAPIClassroom"]), + .library(name: "GitHubRestAPICode_Quality", targets: ["GitHubRestAPICode_Quality"]), .library(name: "GitHubRestAPICode_Scanning", targets: ["GitHubRestAPICode_Scanning"]), .library(name: "GitHubRestAPICode_Security", targets: ["GitHubRestAPICode_Security"]), .library(name: "GitHubRestAPICodes_Of_Conduct", targets: ["GitHubRestAPICodes_Of_Conduct"]), @@ -128,6 +129,14 @@ let package = Package( ], path: "Sources/classroom" ), + .target( + name: "GitHubRestAPICode_Quality", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/code-quality" + ), .target( name: "GitHubRestAPICode_Scanning", dependencies: [ diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 0792a5587b0..c448308da13 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -10598,21 +10598,37 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/include_claim_keys`. public var includeClaimKeys: [Swift.String]? + /// Whether the repository has opted in to the immutable OIDC subject claim format. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. If not set at the repository level, falls back to the organization-level setting. + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/use_immutable_subject`. + public var useImmutableSubject: Swift.Bool? + /// The current `sub` claim prefix for this repository. + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/sub_claim_prefix`. + public var subClaimPrefix: Swift.String? /// Creates a new `OidcCustomSubRepo`. /// /// - Parameters: /// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// - useImmutableSubject: Whether the repository has opted in to the immutable OIDC subject claim format. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. If not set at the repository level, falls back to the organization-level setting. + /// - subClaimPrefix: The current `sub` claim prefix for this repository. public init( useDefault: Swift.Bool, - includeClaimKeys: [Swift.String]? = nil + includeClaimKeys: [Swift.String]? = nil, + useImmutableSubject: Swift.Bool? = nil, + subClaimPrefix: Swift.String? = nil ) { self.useDefault = useDefault self.includeClaimKeys = includeClaimKeys + self.useImmutableSubject = useImmutableSubject + self.subClaimPrefix = subClaimPrefix } public enum CodingKeys: String, CodingKey { case useDefault = "use_default" case includeClaimKeys = "include_claim_keys" + case useImmutableSubject = "use_immutable_subject" + case subClaimPrefix = "sub_claim_prefix" } } /// Set secrets for GitHub Actions. @@ -16917,6 +16933,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/size`. public var size: Swift.String? + /// The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_source`. + @frozen public enum ImageSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + case partner = "partner" + case custom = "custom" + } + /// The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_source`. + public var imageSource: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload.ImageSourcePayload? /// 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`. @@ -16925,6 +16953,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_version`. public var imageVersion: Swift.String? + /// Whether to enable image generation for this runner pool. When enabled, the runner pool is used to build and publish custom runner images. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_gen`. + public var imageGen: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -16933,24 +16965,30 @@ public enum Operations { /// - 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` + /// - imageSource: The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`. /// - 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. + /// - imageGen: Whether to enable image generation for this runner pool. When enabled, the runner pool is used to build and publish custom runner images. public init( name: Swift.String? = nil, runnerGroupId: Swift.Int? = nil, maximumRunners: Swift.Int? = nil, enableStaticIp: Swift.Bool? = nil, size: Swift.String? = nil, + imageSource: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload.ImageSourcePayload? = nil, imageId: Swift.String? = nil, - imageVersion: Swift.String? = nil + imageVersion: Swift.String? = nil, + imageGen: Swift.Bool? = nil ) { self.name = name self.runnerGroupId = runnerGroupId self.maximumRunners = maximumRunners self.enableStaticIp = enableStaticIp self.size = size + self.imageSource = imageSource self.imageId = imageId self.imageVersion = imageVersion + self.imageGen = imageGen } public enum CodingKeys: String, CodingKey { case name @@ -16958,8 +16996,10 @@ public enum Operations { case maximumRunners = "maximum_runners" case enableStaticIp = "enable_static_ip" case size + case imageSource = "image_source" case imageId = "image_id" case imageVersion = "image_version" + case imageGen = "image_gen" } } /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. @@ -30462,21 +30502,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. public var includeClaimKeys: [Swift.String]? + /// Whether to opt in to the immutable OIDC subject claim format for this repository. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_immutable_subject`. + public var useImmutableSubject: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// - useImmutableSubject: Whether to opt in to the immutable OIDC subject claim format for this repository. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. public init( useDefault: Swift.Bool, - includeClaimKeys: [Swift.String]? = nil + includeClaimKeys: [Swift.String]? = nil, + useImmutableSubject: Swift.Bool? = nil ) { self.useDefault = useDefault self.includeClaimKeys = includeClaimKeys + self.useImmutableSubject = useImmutableSubject } public enum CodingKeys: String, CodingKey { case useDefault = "use_default" case includeClaimKeys = "include_claim_keys" + case useImmutableSubject = "use_immutable_subject" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. diff --git a/Sources/code-quality/Client.swift b/Sources/code-quality/Client.swift new file mode 100644 index 00000000000..87202523ac7 --- /dev/null +++ b/Sources/code-quality/Client.swift @@ -0,0 +1,41 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +import HTTPTypes +/// GitHub's v3 REST API. +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } +} diff --git a/Sources/code-quality/Types.swift b/Sources/code-quality/Types.swift new file mode 100644 index 00000000000..c3d1209ecf5 --- /dev/null +++ b/Sources/code-quality/Types.swift @@ -0,0 +1,53 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable {} + +/// Convenience overloads for operation inputs. +extension APIProtocol { +} + +/// Server URLs defined in the OpenAPI document. +public enum Servers { + public enum Server1 { + public static func url() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } + } + @available(*, deprecated, renamed: "Servers.Server1.url") + public static func server1() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } +} + +/// Types generated from the components section of the OpenAPI document. +public enum Components { + /// Types generated from the `#/components/schemas` section of the OpenAPI document. + public enum Schemas {} + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters {} + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses {} + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers {} +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations {} diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index 312b5305432..c1519533c71 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -6445,12 +6445,12 @@ public enum Operations { /// An array of repository IDs to detach from configurations. Up to 250 IDs can be provided. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? + public var selectedRepositoryIds: [Swift.Int] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 250 IDs can be provided. - public init(selectedRepositoryIds: [Swift.Int]? = nil) { + public init(selectedRepositoryIds: [Swift.Int]) { self.selectedRepositoryIds = selectedRepositoryIds } public enum CodingKeys: String, CodingKey { @@ -6458,7 +6458,7 @@ public enum Operations { } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.selectedRepositoryIds = try container.decodeIfPresent( + self.selectedRepositoryIds = try container.decode( [Swift.Int].self, forKey: .selectedRepositoryIds ) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 716b10b154f..a61fd68a4bd 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -274,6 +274,338 @@ public struct Client: APIProtocol { } ) } + /// Lists the repositories Dependabot can access in an enterprise + /// + /// Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-for-enterprise)`. + public func dependabotRepositoryAccessForEnterprise(_ input: Operations.DependabotRepositoryAccessForEnterprise.Input) async throws -> Operations.DependabotRepositoryAccessForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotRepositoryAccessForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/dependabot/repository-access", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DependabotRepositoryAccessForEnterprise.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.DependabotRepositoryAccessDetails.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 + ) + ) + } + } + ) + } + /// Updates Dependabot's repository access list for an enterprise + /// + /// Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)`. + public func dependabotUpdateRepositoryAccessForEnterprise(_ input: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input) async throws -> Operations.DependabotUpdateRepositoryAccessForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotUpdateRepositoryAccessForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/dependabot/repository-access", + parameters: [ + input.path.enterprise + ] + ) + 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set the default repository access level for Dependabot in an enterprise + /// + /// Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)`. + public func dependabotSetRepositoryAccessDefaultLevelForEnterprise(_ input: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/dependabot/repository-access/default-level", + parameters: [ + input.path.enterprise + ] + ) + 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List Dependabot alerts for an organization /// /// Lists Dependabot alerts for an organization. diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index f3e34fbb733..0582c78800e 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -24,6 +24,43 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. func dependabotListAlertsForEnterprise(_ input: Operations.DependabotListAlertsForEnterprise.Input) async throws -> Operations.DependabotListAlertsForEnterprise.Output + /// Lists the repositories Dependabot can access in an enterprise + /// + /// Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-for-enterprise)`. + func dependabotRepositoryAccessForEnterprise(_ input: Operations.DependabotRepositoryAccessForEnterprise.Input) async throws -> Operations.DependabotRepositoryAccessForEnterprise.Output + /// Updates Dependabot's repository access list for an enterprise + /// + /// Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)`. + func dependabotUpdateRepositoryAccessForEnterprise(_ input: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input) async throws -> Operations.DependabotUpdateRepositoryAccessForEnterprise.Output + /// Set the default repository access level for Dependabot in an enterprise + /// + /// Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)`. + func dependabotSetRepositoryAccessDefaultLevelForEnterprise(_ input: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Output /// List Dependabot alerts for an organization /// /// Lists Dependabot alerts for an organization. @@ -267,6 +304,73 @@ extension APIProtocol { headers: headers )) } + /// Lists the repositories Dependabot can access in an enterprise + /// + /// Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-for-enterprise)`. + public func dependabotRepositoryAccessForEnterprise( + path: Operations.DependabotRepositoryAccessForEnterprise.Input.Path, + query: Operations.DependabotRepositoryAccessForEnterprise.Input.Query = .init(), + headers: Operations.DependabotRepositoryAccessForEnterprise.Input.Headers = .init() + ) async throws -> Operations.DependabotRepositoryAccessForEnterprise.Output { + try await dependabotRepositoryAccessForEnterprise(Operations.DependabotRepositoryAccessForEnterprise.Input( + path: path, + query: query, + headers: headers + )) + } + /// Updates Dependabot's repository access list for an enterprise + /// + /// Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)`. + public func dependabotUpdateRepositoryAccessForEnterprise( + path: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Path, + headers: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Headers = .init(), + body: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Body + ) async throws -> Operations.DependabotUpdateRepositoryAccessForEnterprise.Output { + try await dependabotUpdateRepositoryAccessForEnterprise(Operations.DependabotUpdateRepositoryAccessForEnterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set the default repository access level for Dependabot in an enterprise + /// + /// Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)`. + public func dependabotSetRepositoryAccessDefaultLevelForEnterprise( + path: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Path, + headers: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Headers = .init(), + body: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Body + ) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Output { + try await dependabotSetRepositoryAccessDefaultLevelForEnterprise(Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input( + path: path, + headers: headers, + body: body + )) + } /// List Dependabot alerts for an organization /// /// Lists Dependabot alerts for an organization. @@ -2608,737 +2712,241 @@ public enum Components { ]) } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct SecurityAndAnalysis: Codable, Hashable, Sendable { - /// Enable or disable GitHub Advanced Security for the repository. + /// A GitHub repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository`. + public struct NullableSimpleRepository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. /// - /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/id`. + public var id: Swift.Int64 + /// The GraphQL identifier of the repository. /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/node_id`. + public var nodeId: Swift.String + /// The name of the repository. /// - /// - 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/nullable-simple-repository/name`. + public var name: Swift.String + /// The full, globally unique, name of the repository. /// - /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private. /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. /// - /// - 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/nullable-simple-repository/html_url`. + public var htmlUrl: Swift.String + /// The repository description. /// - /// - 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/nullable-simple-repository/description`. + public var description: Swift.String? + /// Whether the repository is a fork. /// - /// - 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 - /// The bypass mode for the reviewer - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. - @frozen public enum ModePayload: String, Codable, Hashable, Sendable, CaseIterable { - case always = "ALWAYS" - case exempt = "EXEMPT" - } - /// The bypass mode for the reviewer - /// - /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. - public var mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? - /// 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 - /// - mode: The bypass mode for the reviewer - public init( - reviewerId: Swift.Int, - reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload, - mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? = nil - ) { - self.reviewerId = reviewerId - self.reviewerType = reviewerType - self.mode = mode - } - public enum CodingKeys: String, CodingKey { - case reviewerId = "reviewer_id" - case reviewerType = "reviewer_type" - case mode - } - } - /// 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" - } - } - /// Minimal Repository - /// - /// - 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/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`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/fork`. public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. + /// The URL to get more information about the repository from the GitHub API. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. + /// A template for the API URL to download the repository as an archive. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/archive_url`. public var archiveUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. + /// A template for the API URL to list the available assignees for issues in the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/assignees_url`. public var assigneesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/blobs_url`. + /// A template for the API URL to create or retrieve a raw Git blob in the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/blobs_url`. public var blobsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/branches_url`. + /// A template for the API URL to get information about branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/branches_url`. public var branchesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/collaborators_url`. + /// A template for the API URL to get information about collaborators of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/collaborators_url`. public var collaboratorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/comments_url`. + /// A template for the API URL to get information about comments on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/comments_url`. public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/commits_url`. + /// A template for the API URL to get information about commits on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/commits_url`. public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/compare_url`. + /// A template for the API URL to compare two commits or refs. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/compare_url`. public var compareUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/contents_url`. + /// A template for the API URL to get the contents of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/contents_url`. public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/contributors_url`. + /// A template for the API URL to list the contributors to the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/contributors_url`. public var contributorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/deployments_url`. + /// The API URL to list the deployments of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/deployments_url`. public var deploymentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/downloads_url`. + /// The API URL to list the downloads on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/downloads_url`. public var downloadsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/events_url`. + /// The API URL to list the events of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/events_url`. public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_url`. + /// The API URL to list the forks of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/forks_url`. public var forksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_commits_url`. + /// A template for the API URL to get information about Git commits of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_commits_url`. public var gitCommitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_refs_url`. + /// A template for the API URL to get information about Git refs of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_refs_url`. public var gitRefsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/git_tags_url`. + /// A template for the API URL to get information about Git tags of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-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`. + /// A template for the API URL to get information about issue comments on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_comment_url`. public var issueCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_events_url`. + /// A template for the API URL to get information about issue events on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_events_url`. public var issueEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/issues_url`. + /// A template for the API URL to get information about issues on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issues_url`. public var issuesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/keys_url`. + /// A template for the API URL to get information about deploy keys on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/keys_url`. public var keysUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/labels_url`. + /// A template for the API URL to get information about labels of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/labels_url`. public var labelsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/languages_url`. + /// The API URL to get information about the languages of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/languages_url`. public var languagesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/merges_url`. + /// The API URL to merge branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/merges_url`. public var mergesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/milestones_url`. + /// A template for the API URL to get information about milestones of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/milestones_url`. public var milestonesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/notifications_url`. + /// A template for the API URL to get information about notifications on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/notifications_url`. public var notificationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/pulls_url`. + /// A template for the API URL to get information about pull requests on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/pulls_url`. public var pullsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/releases_url`. + /// A template for the API URL to get information about releases on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-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`. + /// The API URL to list the stargazers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/stargazers_url`. public var stargazersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/statuses_url`. + /// A template for the API URL to get information about statuses of a commit. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/statuses_url`. public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_url`. + /// The API URL to list the subscribers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscribers_url`. public var subscribersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/subscription_url`. + /// The API URL to subscribe to notifications for this repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscription_url`. public var subscriptionUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/minimal-repository/tags_url`. + /// The API URL to get information about tags on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-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. + /// The API URL to list the teams on the repository. /// - /// - 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/nullable-simple-repository/teams_url`. + public var teamsUrl: Swift.String + /// A template for the API URL to create or retrieve a raw Git tree of the repository. /// - /// - 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/nullable-simple-repository/trees_url`. + public var treesUrl: Swift.String + /// The API URL to list the hooks on the repository. /// - /// - 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/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`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/hooks_url`. + public var hooksUrl: Swift.String + /// Creates a new `NullableSimpleRepository`. /// /// - Parameters: - /// - id: - /// - nodeId: - /// - name: - /// - fullName: + /// - id: A unique identifier of the repository. + /// - nodeId: The GraphQL identifier of the repository. + /// - name: The name of the repository. + /// - fullName: The full, globally unique, name of the repository. /// - owner: - /// - _private: - /// - htmlUrl: - /// - description: - /// - fork: - /// - url: - /// - archiveUrl: - /// - assigneesUrl: - /// - blobsUrl: - /// - branchesUrl: - /// - collaboratorsUrl: - /// - commentsUrl: - /// - commitsUrl: - /// - compareUrl: - /// - contentsUrl: - /// - contributorsUrl: - /// - deploymentsUrl: - /// - downloadsUrl: - /// - eventsUrl: - /// - forksUrl: - /// - gitCommitsUrl: - /// - gitRefsUrl: - /// - gitTagsUrl: - /// - gitUrl: - /// - issueCommentUrl: - /// - issueEventsUrl: - /// - issuesUrl: - /// - 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. - /// - 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. + /// - _private: Whether the repository is private. + /// - htmlUrl: The URL to view the repository on GitHub.com. + /// - description: The repository description. + /// - fork: Whether the repository is a fork. + /// - url: The URL to get more information about the repository from the GitHub API. + /// - archiveUrl: A template for the API URL to download the repository as an archive. + /// - assigneesUrl: A template for the API URL to list the available assignees for issues in the repository. + /// - blobsUrl: A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - branchesUrl: A template for the API URL to get information about branches in the repository. + /// - collaboratorsUrl: A template for the API URL to get information about collaborators of the repository. + /// - commentsUrl: A template for the API URL to get information about comments on the repository. + /// - commitsUrl: A template for the API URL to get information about commits on the repository. + /// - compareUrl: A template for the API URL to compare two commits or refs. + /// - contentsUrl: A template for the API URL to get the contents of the repository. + /// - contributorsUrl: A template for the API URL to list the contributors to the repository. + /// - deploymentsUrl: The API URL to list the deployments of the repository. + /// - downloadsUrl: The API URL to list the downloads on the repository. + /// - eventsUrl: The API URL to list the events of the repository. + /// - forksUrl: The API URL to list the forks of the repository. + /// - gitCommitsUrl: A template for the API URL to get information about Git commits of the repository. + /// - gitRefsUrl: A template for the API URL to get information about Git refs of the repository. + /// - gitTagsUrl: A template for the API URL to get information about Git tags of the repository. + /// - issueCommentUrl: A template for the API URL to get information about issue comments on the repository. + /// - issueEventsUrl: A template for the API URL to get information about issue events on the repository. + /// - issuesUrl: A template for the API URL to get information about issues on the repository. + /// - keysUrl: A template for the API URL to get information about deploy keys on the repository. + /// - labelsUrl: A template for the API URL to get information about labels of the repository. + /// - languagesUrl: The API URL to get information about the languages of the repository. + /// - mergesUrl: The API URL to merge branches in the repository. + /// - milestonesUrl: A template for the API URL to get information about milestones of the repository. + /// - notificationsUrl: A template for the API URL to get information about notifications on the repository. + /// - pullsUrl: A template for the API URL to get information about pull requests on the repository. + /// - releasesUrl: A template for the API URL to get information about releases on the repository. + /// - stargazersUrl: The API URL to list the stargazers on the repository. + /// - statusesUrl: A template for the API URL to get information about statuses of a commit. + /// - subscribersUrl: The API URL to list the subscribers on the repository. + /// - subscriptionUrl: The API URL to subscribe to notifications for this repository. + /// - tagsUrl: The API URL to get information about tags on the repository. + /// - teamsUrl: The API URL to list the teams on the repository. + /// - treesUrl: A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - hooksUrl: The API URL to list the hooks on the repository. public init( id: Swift.Int64, nodeId: Swift.String, @@ -3367,7 +2975,6 @@ public enum Components { gitCommitsUrl: Swift.String, gitRefsUrl: Swift.String, gitTagsUrl: Swift.String, - gitUrl: Swift.String? = nil, issueCommentUrl: Swift.String, issueEventsUrl: Swift.String, issuesUrl: Swift.String, @@ -3379,7 +2986,6 @@ public enum Components { notificationsUrl: Swift.String, pullsUrl: Swift.String, releasesUrl: Swift.String, - sshUrl: Swift.String? = nil, stargazersUrl: Swift.String, statusesUrl: Swift.String, subscribersUrl: Swift.String, @@ -3387,49 +2993,7 @@ public enum Components { 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, - 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 + hooksUrl: Swift.String ) { self.id = id self.nodeId = nodeId @@ -3458,7 +3022,6 @@ public enum Components { self.gitCommitsUrl = gitCommitsUrl self.gitRefsUrl = gitRefsUrl self.gitTagsUrl = gitTagsUrl - self.gitUrl = gitUrl self.issueCommentUrl = issueCommentUrl self.issueEventsUrl = issueEventsUrl self.issuesUrl = issuesUrl @@ -3470,7 +3033,6 @@ public enum Components { self.notificationsUrl = notificationsUrl self.pullsUrl = pullsUrl self.releasesUrl = releasesUrl - self.sshUrl = sshUrl self.stargazersUrl = stargazersUrl self.statusesUrl = statusesUrl self.subscribersUrl = subscribersUrl @@ -3478,49 +3040,7 @@ public enum Components { 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.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 id @@ -3550,7 +3070,6 @@ public enum Components { 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" @@ -3562,7 +3081,6 @@ public enum Components { 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" @@ -3570,1333 +3088,2555 @@ public enum Components { 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 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" - } - } - /// 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 Swift.Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) } } - /// A GitHub repository. + /// Information about repositories that Dependabot is able to access in an organization /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository`. - public struct NullableSimpleRepository: Codable, Hashable, Sendable { - /// A unique identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/id`. - public var id: Swift.Int64 - /// The GraphQL identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/node_id`. - public var nodeId: Swift.String - /// The name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/name`. - public var name: Swift.String - /// The full, globally unique, name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/full_name`. - public var fullName: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/owner`. - public var owner: Components.Schemas.SimpleUser - /// Whether the repository is private. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/private`. - public var _private: Swift.Bool - /// The URL to view the repository on GitHub.com. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/html_url`. - public var htmlUrl: Swift.String - /// The repository description. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/description`. - public var description: Swift.String? - /// Whether the repository is a fork. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/fork`. - public var fork: Swift.Bool - /// The URL to get more information about the repository from the GitHub API. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/url`. - public var url: Swift.String - /// A template for the API URL to download the repository as an archive. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/archive_url`. - public var archiveUrl: Swift.String - /// A template for the API URL to list the available assignees for issues in the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/assignees_url`. - public var assigneesUrl: Swift.String - /// A template for the API URL to create or retrieve a raw Git blob in the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/blobs_url`. - public var blobsUrl: Swift.String - /// A template for the API URL to get information about branches in the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/branches_url`. - public var branchesUrl: Swift.String - /// A template for the API URL to get information about collaborators of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/collaborators_url`. - public var collaboratorsUrl: Swift.String - /// A template for the API URL to get information about comments on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details`. + public struct DependabotRepositoryAccessDetails: Codable, Hashable, Sendable { + /// The default repository access level for Dependabot updates. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/comments_url`. - public var commentsUrl: Swift.String - /// A template for the API URL to get information about commits on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. + @frozen public enum DefaultLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _public = "public" + case _internal = "internal" + } + /// The default repository access level for Dependabot updates. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/commits_url`. - public var commitsUrl: Swift.String - /// A template for the API URL to compare two commits or refs. + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. + public var defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/accessible_repositories`. + public var accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? + /// Creates a new `DependabotRepositoryAccessDetails`. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/compare_url`. - public var compareUrl: Swift.String - /// A template for the API URL to get the contents of the repository. + /// - Parameters: + /// - defaultLevel: The default repository access level for Dependabot updates. + /// - accessibleRepositories: + public init( + defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? = nil, + accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? = nil + ) { + self.defaultLevel = defaultLevel + self.accessibleRepositories = accessibleRepositories + } + public enum CodingKeys: String, CodingKey { + case defaultLevel = "default_level" + case accessibleRepositories = "accessible_repositories" + } + 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, + forKey: .defaultLevel + ) + self.accessibleRepositories = try container.decodeIfPresent( + [Components.Schemas.NullableSimpleRepository].self, + forKey: .accessibleRepositories + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "default_level", + "accessible_repositories" + ]) + } + } + /// - 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/nullable-simple-repository/contents_url`. - public var contentsUrl: Swift.String - /// A template for the API URL to list the contributors to the repository. + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/contributors_url`. - public var contributorsUrl: Swift.String - /// The API URL to list the deployments of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/deployments_url`. - public var deploymentsUrl: Swift.String - /// The API URL to list the downloads on the repository. + /// - 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/nullable-simple-repository/downloads_url`. - public var downloadsUrl: Swift.String - /// The API URL to list the events of the repository. + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/events_url`. - public var eventsUrl: Swift.String - /// The API URL to list the forks of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/forks_url`. - public var forksUrl: Swift.String - /// A template for the API URL to get information about Git commits of the repository. + /// - 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/nullable-simple-repository/git_commits_url`. - public var gitCommitsUrl: Swift.String - /// A template for the API URL to get information about Git refs of 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/nullable-simple-repository/git_refs_url`. - public var gitRefsUrl: Swift.String - /// A template for the API URL to get information about Git tags of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_tags_url`. - public var gitTagsUrl: Swift.String - /// A template for the API URL to get information about issue comments on the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_comment_url`. - public var issueCommentUrl: Swift.String - /// A template for the API URL to get information about issue events on the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_events_url`. - public var issueEventsUrl: Swift.String - /// A template for the API URL to get information about issues on the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issues_url`. - public var issuesUrl: Swift.String - /// A template for the API URL to get information about deploy keys on the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/keys_url`. - public var keysUrl: Swift.String - /// A template for the API URL to get information about labels of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/labels_url`. - public var labelsUrl: Swift.String - /// The API URL to get information about the languages of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/languages_url`. - public var languagesUrl: Swift.String - /// The API URL to merge branches in the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/merges_url`. - public var mergesUrl: Swift.String - /// A template for the API URL to get information about milestones of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/milestones_url`. - public var milestonesUrl: Swift.String - /// A template for the API URL to get information about notifications on 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 + /// The bypass mode for the reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. + @frozen public enum ModePayload: String, Codable, Hashable, Sendable, CaseIterable { + case always = "ALWAYS" + case exempt = "EXEMPT" + } + /// The bypass mode for the reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. + public var mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? + /// 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 + /// - mode: The bypass mode for the reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload, + mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? = nil + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + self.mode = mode + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + case mode + } + } + /// 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`. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/notifications_url`. - public var notificationsUrl: Swift.String - /// A template for the API URL to get information about pull requests on the repository. + /// - 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" + } + } + /// Minimal Repository + /// + /// - 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/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/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/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/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/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: + /// - id: + /// - nodeId: + /// - name: + /// - fullName: + /// - owner: + /// - _private: + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - 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. + /// - 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( + 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, + 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, + 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, + 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, + 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.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.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.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + 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.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 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 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" + } + } + /// 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 Swift.Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Secrets for GitHub Dependabot for an organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret`. + public struct OrganizationDependabotSecret: Codable, Hashable, Sendable { + /// The name of the secret. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/pulls_url`. - public var pullsUrl: Swift.String - /// A template for the API URL to get information about releases on the repository. + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Visibility of a secret /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/releases_url`. - public var releasesUrl: Swift.String - /// The API URL to list the stargazers on the repository. + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Visibility of a secret /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/stargazers_url`. - public var stargazersUrl: Swift.String - /// A template for the API URL to get information about statuses of a commit. + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. + public var visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `OrganizationDependabotSecret`. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/statuses_url`. - public var statusesUrl: Swift.String - /// The API URL to list the subscribers on the repository. + /// - Parameters: + /// - name: The name of the secret. + /// - createdAt: + /// - updatedAt: + /// - visibility: Visibility of a secret + /// - selectedRepositoriesUrl: + public init( + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + self.visibility = visibility + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case name + case createdAt = "created_at" + case updatedAt = "updated_at" + case visibility + case selectedRepositoriesUrl = "selected_repositories_url" + } + } + /// The public key used for setting Dependabot Secrets. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-public-key`. + public struct DependabotPublicKey: Codable, Hashable, Sendable { + /// The identifier for the key. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscribers_url`. - public var subscribersUrl: Swift.String - /// The API URL to subscribe to notifications for this repository. + /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key_id`. + public var keyId: Swift.String + /// The Base64 encoded public key. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscription_url`. - public var subscriptionUrl: Swift.String - /// The API URL to get information about tags on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key`. + public var key: Swift.String + /// Creates a new `DependabotPublicKey`. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/tags_url`. - public var tagsUrl: Swift.String - /// The API URL to list the teams on the repository. + /// - Parameters: + /// - keyId: The identifier for the key. + /// - key: The Base64 encoded public key. + public init( + keyId: Swift.String, + key: Swift.String + ) { + self.keyId = keyId + self.key = key + } + public enum CodingKeys: String, CodingKey { + case keyId = "key_id" + case key + } + } + /// A Dependabot alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert`. + public struct DependabotAlert: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/dependabot-alert/number`. + public var number: Components.Schemas.AlertNumber + /// The state of the Dependabot alert. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/teams_url`. - public var teamsUrl: Swift.String - /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case autoDismissed = "auto_dismissed" + case dismissed = "dismissed" + case fixed = "fixed" + case open = "open" + } + /// The state of the Dependabot alert. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/trees_url`. - public var treesUrl: Swift.String - /// The API URL to list the hooks on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. + public var state: Components.Schemas.DependabotAlert.StatePayload + /// Details for the vulnerable dependency. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/hooks_url`. - public var hooksUrl: Swift.String - /// Creates a new `NullableSimpleRepository`. + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. + public struct DependencyPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/package`. + public var package: Components.Schemas.DependabotAlertPackage? + /// The full path to the dependency manifest file, relative to the root of the repository. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/manifest_path`. + public var manifestPath: Swift.String? + /// The execution scope of the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. + @frozen public enum ScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case development = "development" + case runtime = "runtime" + } + /// The execution scope of the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. + public var scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + @frozen public enum RelationshipPayload: String, Codable, Hashable, Sendable, CaseIterable { + case unknown = "unknown" + case direct = "direct" + case transitive = "transitive" + case inconclusive = "inconclusive" + } + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + public var relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? + /// Creates a new `DependencyPayload`. + /// + /// - Parameters: + /// - package: + /// - manifestPath: The full path to the dependency manifest file, relative to the root of the repository. + /// - scope: The execution scope of the vulnerable dependency. + /// - relationship: The vulnerable dependency's relationship to your project. + public init( + package: Components.Schemas.DependabotAlertPackage? = nil, + manifestPath: Swift.String? = nil, + scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? = nil, + relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? = nil + ) { + self.package = package + self.manifestPath = manifestPath + self.scope = scope + self.relationship = relationship + } + public enum CodingKeys: String, CodingKey { + case package + case manifestPath = "manifest_path" + case scope + case relationship + } + } + /// Details for the vulnerable dependency. /// - /// - Parameters: - /// - id: A unique identifier of the repository. - /// - nodeId: The GraphQL identifier of the repository. - /// - name: The name of the repository. - /// - fullName: The full, globally unique, name of the repository. - /// - owner: - /// - _private: Whether the repository is private. - /// - htmlUrl: The URL to view the repository on GitHub.com. - /// - description: The repository description. - /// - fork: Whether the repository is a fork. - /// - url: The URL to get more information about the repository from the GitHub API. - /// - archiveUrl: A template for the API URL to download the repository as an archive. - /// - assigneesUrl: A template for the API URL to list the available assignees for issues in the repository. - /// - blobsUrl: A template for the API URL to create or retrieve a raw Git blob in the repository. - /// - branchesUrl: A template for the API URL to get information about branches in the repository. - /// - collaboratorsUrl: A template for the API URL to get information about collaborators of the repository. - /// - commentsUrl: A template for the API URL to get information about comments on the repository. - /// - commitsUrl: A template for the API URL to get information about commits on the repository. - /// - compareUrl: A template for the API URL to compare two commits or refs. - /// - contentsUrl: A template for the API URL to get the contents of the repository. - /// - contributorsUrl: A template for the API URL to list the contributors to the repository. - /// - deploymentsUrl: The API URL to list the deployments of the repository. - /// - downloadsUrl: The API URL to list the downloads on the repository. - /// - eventsUrl: The API URL to list the events of the repository. - /// - forksUrl: The API URL to list the forks of the repository. - /// - gitCommitsUrl: A template for the API URL to get information about Git commits of the repository. - /// - gitRefsUrl: A template for the API URL to get information about Git refs of the repository. - /// - gitTagsUrl: A template for the API URL to get information about Git tags of the repository. - /// - issueCommentUrl: A template for the API URL to get information about issue comments on the repository. - /// - issueEventsUrl: A template for the API URL to get information about issue events on the repository. - /// - issuesUrl: A template for the API URL to get information about issues on the repository. - /// - keysUrl: A template for the API URL to get information about deploy keys on the repository. - /// - labelsUrl: A template for the API URL to get information about labels of the repository. - /// - languagesUrl: The API URL to get information about the languages of the repository. - /// - mergesUrl: The API URL to merge branches in the repository. - /// - milestonesUrl: A template for the API URL to get information about milestones of the repository. - /// - notificationsUrl: A template for the API URL to get information about notifications on the repository. - /// - pullsUrl: A template for the API URL to get information about pull requests on the repository. - /// - releasesUrl: A template for the API URL to get information about releases on the repository. - /// - stargazersUrl: The API URL to list the stargazers on the repository. - /// - statusesUrl: A template for the API URL to get information about statuses of a commit. - /// - subscribersUrl: The API URL to list the subscribers on the repository. - /// - subscriptionUrl: The API URL to subscribe to notifications for this repository. - /// - tagsUrl: The API URL to get information about tags on the repository. - /// - teamsUrl: The API URL to list the teams on the repository. - /// - treesUrl: A template for the API URL to create or retrieve a raw Git tree of the repository. - /// - hooksUrl: The API URL to list the hooks on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. + public var dependency: Components.Schemas.DependabotAlert.DependencyPayload + /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_advisory`. + public var securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory + /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_vulnerability`. + public var securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability + /// - Remark: Generated from `#/components/schemas/dependabot-alert/url`. + public var url: Components.Schemas.AlertUrl + /// - Remark: Generated from `#/components/schemas/dependabot-alert/html_url`. + public var htmlUrl: Components.Schemas.AlertHtmlUrl + /// - Remark: Generated from `#/components/schemas/dependabot-alert/created_at`. + public var createdAt: Components.Schemas.AlertCreatedAt + /// - Remark: Generated from `#/components/schemas/dependabot-alert/updated_at`. + public var updatedAt: Components.Schemas.AlertUpdatedAt + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_at`. + public var dismissedAt: Components.Schemas.AlertDismissedAt? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_by`. + public var dismissedBy: Components.Schemas.NullableSimpleUser? + /// The reason that the alert was dismissed. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/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" + } + /// The reason that the alert was dismissed. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. + public var dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? + /// An optional comment associated with the alert's dismissal. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_comment`. + public var dismissedComment: Swift.String? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/fixed_at`. + 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: + /// - number: + /// - state: The state of the Dependabot alert. + /// - dependency: Details for the vulnerable dependency. + /// - securityAdvisory: + /// - securityVulnerability: + /// - url: + /// - htmlUrl: + /// - createdAt: + /// - updatedAt: + /// - dismissedAt: + /// - dismissedBy: + /// - dismissedReason: The reason that the alert was dismissed. + /// - dismissedComment: An optional comment associated with the alert's dismissal. + /// - fixedAt: + /// - autoDismissedAt: + /// - dismissalRequest: + /// - assignees: The users assigned to this alert. public init( - 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, - 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, - forksUrl: Swift.String, - gitCommitsUrl: Swift.String, - gitRefsUrl: Swift.String, - gitTagsUrl: Swift.String, - issueCommentUrl: Swift.String, - issueEventsUrl: Swift.String, - issuesUrl: Swift.String, - keysUrl: Swift.String, - labelsUrl: Swift.String, - languagesUrl: Swift.String, - mergesUrl: Swift.String, - milestonesUrl: Swift.String, - notificationsUrl: Swift.String, - pullsUrl: Swift.String, - releasesUrl: Swift.String, - stargazersUrl: Swift.String, - statusesUrl: Swift.String, - subscribersUrl: Swift.String, - subscriptionUrl: Swift.String, - tagsUrl: Swift.String, - teamsUrl: Swift.String, - treesUrl: Swift.String, - hooksUrl: Swift.String + number: Components.Schemas.AlertNumber, + state: Components.Schemas.DependabotAlert.StatePayload, + dependency: Components.Schemas.DependabotAlert.DependencyPayload, + securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory, + securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability, + url: Components.Schemas.AlertUrl, + htmlUrl: Components.Schemas.AlertHtmlUrl, + createdAt: Components.Schemas.AlertCreatedAt, + updatedAt: Components.Schemas.AlertUpdatedAt, + dismissedAt: Components.Schemas.AlertDismissedAt? = nil, + dismissedBy: Components.Schemas.NullableSimpleUser? = nil, + dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? = nil, + dismissedComment: Swift.String? = nil, + fixedAt: Components.Schemas.AlertFixedAt? = nil, + autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil, + dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil + ) { + self.number = number + self.state = state + self.dependency = dependency + self.securityAdvisory = securityAdvisory + self.securityVulnerability = securityVulnerability + self.url = url + self.htmlUrl = htmlUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + self.dismissedAt = dismissedAt + self.dismissedBy = dismissedBy + self.dismissedReason = dismissedReason + self.dismissedComment = dismissedComment + self.fixedAt = fixedAt + self.autoDismissedAt = autoDismissedAt + self.dismissalRequest = dismissalRequest + self.assignees = assignees + } + public enum CodingKeys: String, CodingKey { + case number + case state + case dependency + case securityAdvisory = "security_advisory" + case securityVulnerability = "security_vulnerability" + case url + case htmlUrl = "html_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + case dismissedAt = "dismissed_at" + case dismissedBy = "dismissed_by" + case dismissedReason = "dismissed_reason" + case dismissedComment = "dismissed_comment" + case fixedAt = "fixed_at" + case autoDismissedAt = "auto_dismissed_at" + case dismissalRequest = "dismissal_request" + case assignees + } + 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, + forKey: .number + ) + self.state = try container.decode( + Components.Schemas.DependabotAlert.StatePayload.self, + forKey: .state + ) + self.dependency = try container.decode( + Components.Schemas.DependabotAlert.DependencyPayload.self, + forKey: .dependency + ) + self.securityAdvisory = try container.decode( + Components.Schemas.DependabotAlertSecurityAdvisory.self, + forKey: .securityAdvisory + ) + self.securityVulnerability = try container.decode( + Components.Schemas.DependabotAlertSecurityVulnerability.self, + forKey: .securityVulnerability + ) + self.url = try container.decode( + Components.Schemas.AlertUrl.self, + forKey: .url + ) + self.htmlUrl = try container.decode( + Components.Schemas.AlertHtmlUrl.self, + forKey: .htmlUrl + ) + self.createdAt = try container.decode( + Components.Schemas.AlertCreatedAt.self, + forKey: .createdAt + ) + self.updatedAt = try container.decode( + Components.Schemas.AlertUpdatedAt.self, + forKey: .updatedAt + ) + self.dismissedAt = try container.decodeIfPresent( + Components.Schemas.AlertDismissedAt.self, + forKey: .dismissedAt + ) + self.dismissedBy = try container.decodeIfPresent( + Components.Schemas.NullableSimpleUser.self, + forKey: .dismissedBy + ) + self.dismissedReason = try container.decodeIfPresent( + Components.Schemas.DependabotAlert.DismissedReasonPayload.self, + forKey: .dismissedReason + ) + self.dismissedComment = try container.decodeIfPresent( + Swift.String.self, + forKey: .dismissedComment + ) + self.fixedAt = try container.decodeIfPresent( + Components.Schemas.AlertFixedAt.self, + forKey: .fixedAt + ) + self.autoDismissedAt = try container.decodeIfPresent( + 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", + "dependency", + "security_advisory", + "security_vulnerability", + "url", + "html_url", + "created_at", + "updated_at", + "dismissed_at", + "dismissed_by", + "dismissed_reason", + "dismissed_comment", + "fixed_at", + "auto_dismissed_at", + "dismissal_request", + "assignees" + ]) + } + } + /// Set secrets for Dependabot. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-secret`. + public struct DependabotSecret: Codable, Hashable, Sendable { + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/dependabot-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/dependabot-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `DependabotSecret`. + /// + /// - Parameters: + /// - name: The name of the secret. + /// - createdAt: + /// - updatedAt: + public init( + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date ) { - 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.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.forksUrl = forksUrl - self.gitCommitsUrl = gitCommitsUrl - self.gitRefsUrl = gitRefsUrl - self.gitTagsUrl = gitTagsUrl - self.issueCommentUrl = issueCommentUrl - self.issueEventsUrl = issueEventsUrl - self.issuesUrl = issuesUrl - 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.stargazersUrl = stargazersUrl - self.statusesUrl = statusesUrl - self.subscribersUrl = subscribersUrl - self.subscriptionUrl = subscriptionUrl - self.tagsUrl = tagsUrl - self.teamsUrl = teamsUrl - self.treesUrl = treesUrl - self.hooksUrl = hooksUrl + self.createdAt = createdAt + self.updatedAt = updatedAt } 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 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 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 hooksUrl = "hooks_url" + case createdAt = "created_at" + case updatedAt = "updated_at" } } - /// Information about repositories that Dependabot is able to access in an organization + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-before`. + public typealias PaginationBefore = Swift.String + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-after`. + public typealias PaginationAfter = Swift.String + /// 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`. + 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 slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// + /// Can be: `malware`, `general` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-classifications`. + public typealias DependabotAlertCommaSeparatedClassifications = Swift.String + /// A comma-separated list of states. If specified, only alerts with these states will be returned. + /// + /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-states`. + public typealias DependabotAlertCommaSeparatedStates = Swift.String + /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. + /// + /// Can be: `low`, `medium`, `high`, `critical` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-severities`. + public typealias DependabotAlertCommaSeparatedSeverities = Swift.String + /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. + /// + /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-ecosystems`. + public typealias DependabotAlertCommaSeparatedEcosystems = Swift.String + /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-packages`. + public typealias DependabotAlertCommaSeparatedPackages = Swift.String + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. + public typealias DependabotAlertCommaSeparatedEpss = Swift.String + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + 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 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) + } + } + } + /// 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`. + @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { + case development = "development" + case runtime = "runtime" + } + /// The property by which to sort the results. + /// `created` means when the alert was created. + /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. + @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case epssPercentage = "epss_percentage" + } + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/parameters/secret-name`. + public typealias SecretName = Swift.String + /// A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. /// - /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details`. - public struct DependabotRepositoryAccessDetails: Codable, Hashable, Sendable { - /// The default repository access level for Dependabot updates. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. - @frozen public enum DefaultLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _public = "public" - case _internal = "internal" - } - /// The default repository access level for Dependabot updates. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. - public var defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? - /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/accessible_repositories`. - public var accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? - /// Creates a new `DependabotRepositoryAccessDetails`. - /// - /// - Parameters: - /// - defaultLevel: The default repository access level for Dependabot updates. - /// - accessibleRepositories: - public init( - defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? = nil, - accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? = nil - ) { - self.defaultLevel = defaultLevel - self.accessibleRepositories = accessibleRepositories - } - public enum CodingKeys: String, CodingKey { - case defaultLevel = "default_level" - case accessibleRepositories = "accessible_repositories" + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry-urls`. + public typealias DependabotAlertCommaSeparatedArtifactRegistryUrls = Swift.String + /// A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. + /// + /// Can be: `jfrog-artifactory` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry`. + public typealias DependabotAlertCommaSeparatedArtifactRegistry = Swift.String + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. + @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + case deployment = "deployment" } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + 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 Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.defaultLevel = try container.decodeIfPresent( - Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload.self, - forKey: .defaultLevel - ) - self.accessibleRepositories = try container.decodeIfPresent( - [Components.Schemas.NullableSimpleRepository].self, - forKey: .accessibleRepositories + 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 ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "default_level", - "accessible_repositories" - ]) + } + 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) + } } } - /// Secrets for GitHub Dependabot for an organization. + /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret`. - public struct OrganizationDependabotSecret: Codable, Hashable, Sendable { - /// The name of the secret. - /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/updated_at`. - public var updatedAt: Foundation.Date - /// Visibility of a secret - /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" + /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-runtime-risk`. + public typealias DependabotAlertCommaSeparatedRuntimeRisk = Swift.String + /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. + public typealias DependabotAlertCommaSeparatedManifests = Swift.String + /// The number that identifies a Dependabot alert in its repository. + /// You can find this at the end of the URL for a Dependabot alert within GitHub, + /// or in `number` fields in the response from the + /// `GET /repos/{owner}/{repo}/dependabot/alerts` operation. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-number`. + public typealias DependabotAlertNumber = Components.Schemas.AlertNumber + } + /// 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 + } + } + } } - /// Visibility of a secret + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. - public var visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/selected_repositories_url`. - public var selectedRepositoriesUrl: Swift.String? - /// Creates a new `OrganizationDependabotSecret`. + /// - 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: - /// - name: The name of the secret. - /// - createdAt: - /// - updatedAt: - /// - visibility: Visibility of a secret - /// - selectedRepositoriesUrl: - public init( - name: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload, - selectedRepositoriesUrl: Swift.String? = nil - ) { - self.name = name - self.createdAt = createdAt - self.updatedAt = updatedAt - self.visibility = visibility - self.selectedRepositoriesUrl = selectedRepositoriesUrl + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body } - public enum CodingKeys: String, CodingKey { - case name - case createdAt = "created_at" - case updatedAt = "updated_at" - case visibility - case selectedRepositoriesUrl = "selected_repositories_url" + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body } } - /// The public key used for setting Dependabot Secrets. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key`. - public struct DependabotPublicKey: Codable, Hashable, Sendable { - /// The identifier for the key. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key_id`. - public var keyId: Swift.String - /// The Base64 encoded public key. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key`. - public var key: Swift.String - /// Creates a new `DependabotPublicKey`. + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. /// /// - Parameters: - /// - keyId: The identifier for the key. - /// - key: The Base64 encoded public key. - public init( - keyId: Swift.String, - key: Swift.String - ) { - self.keyId = keyId - self.key = key - } - public enum CodingKeys: String, CodingKey { - case keyId = "key_id" - case key + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body } } - /// A Dependabot alert. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert`. - public struct DependabotAlert: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/dependabot-alert/number`. - public var number: Components.Schemas.AlertNumber - /// The state of the Dependabot alert. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case autoDismissed = "auto_dismissed" - case dismissed = "dismissed" - case fixed = "fixed" - case open = "open" + 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 + } + } + } } - /// The state of the Dependabot alert. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. - public var state: Components.Schemas.DependabotAlert.StatePayload - /// Details for the vulnerable dependency. + /// Received HTTP response body + public var body: Components.Responses.Conflict.Body + /// Creates a new `Conflict`. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. - public struct DependencyPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/package`. - public var package: Components.Schemas.DependabotAlertPackage? - /// The full path to the dependency manifest file, relative to the root of the repository. + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Conflict.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 Dependabot alerts for an enterprise + /// + /// Lists Dependabot alerts for repositories that are owned by the specified enterprise. + /// + /// The authenticated user must be a member of the enterprise to use this endpoint. + /// + /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, 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)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. + public enum DependabotListAlertsForEnterprise { + public static let id: Swift.String = "dependabot/list-alerts-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/manifest_path`. - public var manifestPath: Swift.String? - /// The execution scope of the vulnerable dependency. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. - @frozen public enum ScopePayload: String, Codable, Hashable, Sendable, CaseIterable { - case development = "development" - case runtime = "runtime" + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } - /// The execution scope of the vulnerable dependency. + } + public var path: Operations.DependabotListAlertsForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query`. + public struct Query: Sendable, Hashable { + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. - public var scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? - /// The vulnerable dependency's relationship to your project. + /// Can be: `malware`, `general` /// - /// > [!NOTE] - /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/classification`. + public var classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? + /// A comma-separated list of states. If specified, only alerts with these states will be returned. /// + /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. - @frozen public enum RelationshipPayload: String, Codable, Hashable, Sendable, CaseIterable { - case unknown = "unknown" - case direct = "direct" - case transitive = "transitive" - case inconclusive = "inconclusive" - } - /// The vulnerable dependency's relationship to your project. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/state`. + public var state: Components.Parameters.DependabotAlertCommaSeparatedStates? + /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - /// > [!NOTE] - /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// Can be: `low`, `medium`, `high`, `critical` /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/severity`. + public var severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? + /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. - public var relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? - /// Creates a new `DependencyPayload`. + /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` /// - /// - Parameters: - /// - package: - /// - manifestPath: The full path to the dependency manifest file, relative to the root of the repository. - /// - scope: The execution scope of the vulnerable dependency. - /// - relationship: The vulnerable dependency's relationship to your project. - public init( - package: Components.Schemas.DependabotAlertPackage? = nil, - manifestPath: Swift.String? = nil, - scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? = nil, - relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? = nil - ) { - self.package = package - self.manifestPath = manifestPath - self.scope = scope - self.relationship = relationship + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/ecosystem`. + public var ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? + /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/package`. + public var package: Components.Parameters.DependabotAlertCommaSeparatedPackages? + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. + public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + 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 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) + } + } } - public enum CodingKeys: String, CodingKey { - case package - case manifestPath = "manifest_path" - case scope - case relationship + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// + /// - 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" + case runtime = "runtime" + } + /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/scope`. + public var scope: Components.Parameters.DependabotAlertScope? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. + @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case epssPercentage = "epss_percentage" + } + /// The property by which to sort the results. + /// `created` means when the alert was created. + /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/sort`. + public var sort: Components.Parameters.DependabotAlertSort? + /// - 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/enterprises/{enterprise}/dependabot/alerts/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/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/enterprises/{enterprise}/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/enterprises/{enterprise}/dependabot/alerts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - classification: A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. + /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. + /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. + /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// - 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. + /// - 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( + classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? = nil, + state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, + severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, + ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, + 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, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.classification = classification + self.state = state + self.severity = severity + self.ecosystem = ecosystem + self.package = package + self.epssPercentage = epssPercentage + self.has = has + self.assignee = assignee + self.scope = scope + self.sort = sort + self.direction = direction + self.before = before + self.after = after + self.perPage = perPage } } - /// Details for the vulnerable dependency. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. - public var dependency: Components.Schemas.DependabotAlert.DependencyPayload - /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_advisory`. - public var securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory - /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_vulnerability`. - public var securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability - /// - Remark: Generated from `#/components/schemas/dependabot-alert/url`. - public var url: Components.Schemas.AlertUrl - /// - Remark: Generated from `#/components/schemas/dependabot-alert/html_url`. - public var htmlUrl: Components.Schemas.AlertHtmlUrl - /// - Remark: Generated from `#/components/schemas/dependabot-alert/created_at`. - public var createdAt: Components.Schemas.AlertCreatedAt - /// - Remark: Generated from `#/components/schemas/dependabot-alert/updated_at`. - public var updatedAt: Components.Schemas.AlertUpdatedAt - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_at`. - public var dismissedAt: Components.Schemas.AlertDismissedAt? - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_by`. - public var dismissedBy: Components.Schemas.NullableSimpleUser? - /// The reason that the alert was dismissed. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/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" - } - /// The reason that the alert was dismissed. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. - public var dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? - /// An optional comment associated with the alert's dismissal. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_comment`. - public var dismissedComment: Swift.String? - /// - Remark: Generated from `#/components/schemas/dependabot-alert/fixed_at`. - 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: - /// - number: - /// - state: The state of the Dependabot alert. - /// - dependency: Details for the vulnerable dependency. - /// - securityAdvisory: - /// - securityVulnerability: - /// - url: - /// - htmlUrl: - /// - createdAt: - /// - updatedAt: - /// - dismissedAt: - /// - dismissedBy: - /// - dismissedReason: The reason that the alert was dismissed. - /// - 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, - dependency: Components.Schemas.DependabotAlert.DependencyPayload, - securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory, - securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability, - url: Components.Schemas.AlertUrl, - htmlUrl: Components.Schemas.AlertHtmlUrl, - createdAt: Components.Schemas.AlertCreatedAt, - updatedAt: Components.Schemas.AlertUpdatedAt, - dismissedAt: Components.Schemas.AlertDismissedAt? = nil, - dismissedBy: Components.Schemas.NullableSimpleUser? = nil, - dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? = nil, - dismissedComment: Swift.String? = nil, - fixedAt: Components.Schemas.AlertFixedAt? = nil, - autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil, - dismissalRequest: Components.Schemas.DependabotAlertDismissalRequestSimple? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil - ) { - self.number = number - self.state = state - self.dependency = dependency - self.securityAdvisory = securityAdvisory - self.securityVulnerability = securityVulnerability - self.url = url - self.htmlUrl = htmlUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - self.dismissedAt = dismissedAt - self.dismissedBy = dismissedBy - self.dismissedReason = dismissedReason - self.dismissedComment = dismissedComment - self.fixedAt = fixedAt - self.autoDismissedAt = autoDismissedAt - self.dismissalRequest = dismissalRequest - self.assignees = assignees - } - public enum CodingKeys: String, CodingKey { - case number - case state - case dependency - case securityAdvisory = "security_advisory" - case securityVulnerability = "security_vulnerability" - case url - case htmlUrl = "html_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - case dismissedAt = "dismissed_at" - case dismissedBy = "dismissed_by" - case dismissedReason = "dismissed_reason" - case dismissedComment = "dismissed_comment" - case fixedAt = "fixed_at" - case autoDismissedAt = "auto_dismissed_at" - case dismissalRequest = "dismissal_request" - case assignees - } - 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, - forKey: .number - ) - self.state = try container.decode( - Components.Schemas.DependabotAlert.StatePayload.self, - forKey: .state - ) - self.dependency = try container.decode( - Components.Schemas.DependabotAlert.DependencyPayload.self, - forKey: .dependency - ) - self.securityAdvisory = try container.decode( - Components.Schemas.DependabotAlertSecurityAdvisory.self, - forKey: .securityAdvisory - ) - self.securityVulnerability = try container.decode( - Components.Schemas.DependabotAlertSecurityVulnerability.self, - forKey: .securityVulnerability - ) - self.url = try container.decode( - Components.Schemas.AlertUrl.self, - forKey: .url - ) - self.htmlUrl = try container.decode( - Components.Schemas.AlertHtmlUrl.self, - forKey: .htmlUrl - ) - self.createdAt = try container.decode( - Components.Schemas.AlertCreatedAt.self, - forKey: .createdAt - ) - self.updatedAt = try container.decode( - Components.Schemas.AlertUpdatedAt.self, - forKey: .updatedAt - ) - self.dismissedAt = try container.decodeIfPresent( - Components.Schemas.AlertDismissedAt.self, - forKey: .dismissedAt - ) - self.dismissedBy = try container.decodeIfPresent( - Components.Schemas.NullableSimpleUser.self, - forKey: .dismissedBy - ) - self.dismissedReason = try container.decodeIfPresent( - Components.Schemas.DependabotAlert.DismissedReasonPayload.self, - forKey: .dismissedReason - ) - self.dismissedComment = try container.decodeIfPresent( - Swift.String.self, - forKey: .dismissedComment - ) - self.fixedAt = try container.decodeIfPresent( - Components.Schemas.AlertFixedAt.self, - forKey: .fixedAt - ) - self.autoDismissedAt = try container.decodeIfPresent( - 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", - "dependency", - "security_advisory", - "security_vulnerability", - "url", - "html_url", - "created_at", - "updated_at", - "dismissed_at", - "dismissed_by", - "dismissed_reason", - "dismissed_comment", - "fixed_at", - "auto_dismissed_at", - "dismissal_request", - "assignees" - ]) - } - } - /// Set secrets for Dependabot. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-secret`. - public struct DependabotSecret: Codable, Hashable, Sendable { - /// The name of the secret. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-secret/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/dependabot-secret/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/dependabot-secret/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `DependabotSecret`. + public var query: Operations.DependabotListAlertsForEnterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/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.DependabotListAlertsForEnterprise.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - name: The name of the secret. - /// - createdAt: - /// - updatedAt: + /// - path: + /// - query: + /// - headers: public init( - name: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date + path: Operations.DependabotListAlertsForEnterprise.Input.Path, + query: Operations.DependabotListAlertsForEnterprise.Input.Query = .init(), + headers: Operations.DependabotListAlertsForEnterprise.Input.Headers = .init() ) { - self.name = name - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case name - case createdAt = "created_at" - case updatedAt = "updated_at" + self.path = path + self.query = query + self.headers = headers } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-before`. - public typealias PaginationBefore = Swift.String - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-after`. - public typealias PaginationAfter = Swift.String - /// 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`. - 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 slug version of the enterprise name. - /// - /// - Remark: Generated from `#/components/parameters/enterprise`. - public typealias Enterprise = Swift.String - /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. - /// - /// Can be: `malware`, `general` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-classifications`. - public typealias DependabotAlertCommaSeparatedClassifications = Swift.String - /// A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-states`. - public typealias DependabotAlertCommaSeparatedStates = Swift.String - /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - /// Can be: `low`, `medium`, `high`, `critical` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-severities`. - public typealias DependabotAlertCommaSeparatedSeverities = Swift.String - /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-ecosystems`. - public typealias DependabotAlertCommaSeparatedEcosystems = Swift.String - /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-packages`. - public typealias DependabotAlertCommaSeparatedPackages = Swift.String - /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - /// - An exact number (`n`) - /// - Comparators such as `>n`, `=n`, `<=n` - /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 - /// - /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. - public typealias DependabotAlertCommaSeparatedEpss = Swift.String - /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. - @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case patch = "patch" - } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - 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 Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content/application\/json`. + case json([Components.Schemas.DependabotAlertWithRepository]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.DependabotAlertWithRepository] { + get throws { + switch self { + case let .json(body): + return body + } + } + } } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + /// Received HTTP response body + public var body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.DependabotListAlertsForEnterprise.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.DependabotListAlertsForEnterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } } - 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) - } + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) } - } - /// 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`. - @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { - case development = "development" - case runtime = "runtime" - } - /// The property by which to sort the results. - /// `created` means when the alert was created. - /// `updated` means when the alert's state last changed. - /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. - @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case epssPercentage = "epss_percentage" - } - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The name of the secret. - /// - /// - Remark: Generated from `#/components/parameters/secret-name`. - public typealias SecretName = Swift.String - /// A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry-urls`. - public typealias DependabotAlertCommaSeparatedArtifactRegistryUrls = Swift.String - /// A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. - /// - /// Can be: `jfrog-artifactory` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry`. - public typealias DependabotAlertCommaSeparatedArtifactRegistry = Swift.String - /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. - @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. - @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case patch = "patch" - case deployment = "deployment" + /// 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 + ) + } + } } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. - 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 Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-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 + ) + } } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-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 + ) + } } - 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) + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } } } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - /// 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` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-runtime-risk`. - public typealias DependabotAlertCommaSeparatedRuntimeRisk = Swift.String - /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. - public typealias DependabotAlertCommaSeparatedManifests = Swift.String - /// The number that identifies a Dependabot alert in its repository. - /// You can find this at the end of the URL for a Dependabot alert within GitHub, - /// or in `number` fields in the response from the - /// `GET /repos/{owner}/{repo}/dependabot/alerts` operation. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-number`. - public typealias DependabotAlertNumber = Components.Schemas.AlertNumber - } - /// 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 - } - } + @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" } } - /// 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 static var allCases: [Self] { + [ + .json + ] } } - 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`. + } + /// Lists the repositories Dependabot can access in an enterprise + /// + /// Lists repositories that enterprise admins have allowed Dependabot to access when updating dependencies across organizations in the enterprise. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-for-enterprise)`. + public enum DependabotRepositoryAccessForEnterprise { + public static let id: Swift.String = "dependabot/repository-access-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise 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 - } - } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/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 } } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + public var path: Operations.DependabotRepositoryAccessForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of results to fetch. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/query/page`. + public var page: Swift.Int? + /// Number of results per page. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/query/per_page`. + public var perPage: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of results to fetch. + /// - perPage: Number of results per page. + public init( + page: Swift.Int? = nil, + perPage: Swift.Int? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.DependabotRepositoryAccessForEnterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.DependabotRepositoryAccessForEnterprise.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.DependabotRepositoryAccessForEnterprise.Input.Path, + query: Operations.DependabotRepositoryAccessForEnterprise.Input.Query = .init(), + headers: Operations.DependabotRepositoryAccessForEnterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - 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 - ) + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/GET/responses/200/content/application\/json`. + case json(Components.Schemas.DependabotRepositoryAccessDetails) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.DependabotRepositoryAccessDetails { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// - 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`. + /// Received HTTP response body + public var body: Operations.DependabotRepositoryAccessForEnterprise.Output.Ok.Body + /// Creates a new `Ok`. /// - /// - Throws: An error if `self` is not `.applicationScimJson`. - /// - SeeAlso: `.applicationScimJson`. - public var applicationScimJson: Components.Schemas.ScimError { - get throws { - switch self { - case let .applicationScimJson(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/scim+json", - body: self - ) - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DependabotRepositoryAccessForEnterprise.Output.Ok.Body) { + self.body = body } } - /// Received HTTP response body - public var body: Components.Responses.BadRequest.Body - /// Creates a new `BadRequest`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.BadRequest.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.DependabotRepositoryAccessForEnterprise.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.DependabotRepositoryAccessForEnterprise.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 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 - } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-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 + ) } } } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. + /// Resource not found /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/get(dependabot/repository-access-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) } - 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 - } - } + @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) } } - /// 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 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 Dependabot alerts for an enterprise - /// - /// Lists Dependabot alerts for repositories that are owned by the specified enterprise. + /// Updates Dependabot's repository access list for an enterprise /// - /// The authenticated user must be a member of the enterprise to use this endpoint. + /// Updates repositories according to the list of repositories that enterprise admins have given Dependabot access to when they've updated dependencies across organizations in the enterprise. /// - /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// The authenticated user must be an enterprise owner to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. - public enum DependabotListAlertsForEnterprise { - public static let id: Swift.String = "dependabot/list-alerts-for-enterprise" + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)`. + public enum DependabotUpdateRepositoryAccessForEnterprise { + public static let id: Swift.String = "dependabot/update-repository-access-for-enterprise" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/path`. public struct Path: Sendable, Hashable { /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path/enterprise`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// @@ -4906,297 +5646,298 @@ public enum Operations { self.enterprise = enterprise } } - public var path: Operations.DependabotListAlertsForEnterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query`. - public struct Query: Sendable, Hashable { - /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. - /// - /// Can be: `malware`, `general` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/classification`. - public var classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? - /// A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/state`. - public var state: Components.Parameters.DependabotAlertCommaSeparatedStates? - /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - /// Can be: `low`, `medium`, `high`, `critical` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/severity`. - public var severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? - /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/ecosystem`. - public var ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? - /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/package`. - public var package: Components.Parameters.DependabotAlertCommaSeparatedPackages? - /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - /// - An exact number (`n`) - /// - Comparators such as `>n`, `=n`, `<=n` - /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 - /// - /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. - public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. - @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case patch = "patch" - } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - 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 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) - } - } - } - /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. - /// - /// - 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" - case runtime = "runtime" - } - /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/scope`. - public var scope: Components.Parameters.DependabotAlertScope? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. - @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case epssPercentage = "epss_percentage" - } - /// The property by which to sort the results. - /// `created` means when the alert was created. - /// `updated` means when the alert's state last changed. - /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/sort`. - public var sort: Components.Parameters.DependabotAlertSort? - /// - 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/enterprises/{enterprise}/dependabot/alerts/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/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/enterprises/{enterprise}/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/enterprises/{enterprise}/dependabot/alerts/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - classification: A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. - /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - 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. - /// - 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( - classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? = nil, - state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, - severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, - ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, - 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, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.classification = classification - self.state = state - self.severity = severity - self.ecosystem = ecosystem - self.package = package - self.epssPercentage = epssPercentage - self.has = has - self.assignee = assignee - self.scope = scope - self.sort = sort - self.direction = direction - self.before = before - self.after = after - self.perPage = perPage - } - } - public var query: Operations.DependabotListAlertsForEnterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/header`. + public var path: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/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.DependabotListAlertsForEnterprise.Input.Headers + public var headers: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs to add. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/requestBody/json/repository_ids_to_add`. + public var repositoryIdsToAdd: [Swift.Int]? + /// List of repository IDs to remove. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/requestBody/json/repository_ids_to_remove`. + public var repositoryIdsToRemove: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - repositoryIdsToAdd: List of repository IDs to add. + /// - repositoryIdsToRemove: List of repository IDs to remove. + public init( + repositoryIdsToAdd: [Swift.Int]? = nil, + repositoryIdsToRemove: [Swift.Int]? = nil + ) { + self.repositoryIdsToAdd = repositoryIdsToAdd + self.repositoryIdsToRemove = repositoryIdsToRemove + } + public enum CodingKeys: String, CodingKey { + case repositoryIdsToAdd = "repository_ids_to_add" + case repositoryIdsToRemove = "repository_ids_to_remove" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/PATCH/requestBody/content/application\/json`. + case json(Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Body.JsonPayload) + } + public var body: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.DependabotListAlertsForEnterprise.Input.Path, - query: Operations.DependabotListAlertsForEnterprise.Input.Query = .init(), - headers: Operations.DependabotListAlertsForEnterprise.Input.Headers = .init() + path: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Path, + headers: Operations.DependabotUpdateRepositoryAccessForEnterprise.Input.Headers = .init(), + body: Operations.DependabotUpdateRepositoryAccessForEnterprise.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/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content/application\/json`. - case json([Components.Schemas.DependabotAlertWithRepository]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.DependabotAlertWithRepository] { - 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//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.DependabotUpdateRepositoryAccessForEnterprise.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-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.DependabotUpdateRepositoryAccessForEnterprise.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.DependabotListAlertsForEnterprise.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body) { - self.body = body + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-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 + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/patch(dependabot/update-repository-access-for-enterprise)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.DependabotListAlertsForEnterprise.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.DependabotListAlertsForEnterprise.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 ) } } } - /// Not modified + /// Undocumented response. /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// 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 the default repository access level for Dependabot in an enterprise + /// + /// Sets the default level of repository access Dependabot will have while performing an update across organizations in the enterprise. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// The authenticated user must be an enterprise owner to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)`. + public enum DependabotSetRepositoryAccessDefaultLevelForEnterprise { + public static let id: Swift.String = "dependabot/set-repository-access-default-level-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/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.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/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.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/requestBody/json/default_level`. + @frozen public enum DefaultLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _public = "public" + case _internal = "internal" + } + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/requestBody/json/default_level`. + public var defaultLevel: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Body.JsonPayload.DefaultLevelPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - defaultLevel: The default repository access level for Dependabot updates. + public init(defaultLevel: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Body.JsonPayload.DefaultLevelPayload) { + self.defaultLevel = defaultLevel + } + public enum CodingKeys: String, CodingKey { + case defaultLevel = "default_level" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/repository-access/default-level/PUT/requestBody/content/application\/json`. + case json(Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Body.JsonPayload) + } + public var body: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Body + /// Creates a new `Input`. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Path, + headers: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Input.Headers = .init(), + body: Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.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}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)/responses/204`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// HTTP response code: `204 noContent`. + case noContent(Operations.DependabotSetRepositoryAccessDefaultLevelForEnterprise.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-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 `.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.DependabotSetRepositoryAccessDefaultLevelForEnterprise.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 ) } @@ -5204,7 +5945,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5227,7 +5968,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level-for-enterprise)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -5248,29 +5989,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/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. diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 0a2dab5cc44..95e5405dd12 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -3977,19 +3977,31 @@ public struct Client: APIProtocol { } ) } - /// List labels for an issue + /// Add issue field values to an issue /// - /// Lists all labels for 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. /// - /// - 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 { + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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.IssuesListLabelsOnIssue.id, + forOperation: Operations.IssuesAddIssueFieldValues.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, @@ -3998,39 +4010,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: "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.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.IssuesAddIssueFieldValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4040,7 +4042,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + [Components.Schemas.IssueFieldValue].self, from: responseBody, transforming: { value in .json(value) @@ -4049,13 +4051,41 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 301: + return .ok(.init(body: body)) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.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: [ @@ -4074,7 +4104,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 @@ -4097,9 +4127,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: [ @@ -4109,7 +4139,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) @@ -4118,7 +4148,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + 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, @@ -4131,19 +4183,32 @@ public struct Client: APIProtocol { } ) } - /// Add labels to an issue + /// Set issue field values for an issue /// - /// Adds labels to 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. /// - /// - 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 { + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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.IssuesAddLabels.id, + forOperation: Operations.IssuesSetIssueFieldValues.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, @@ -4152,7 +4217,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4161,10 +4226,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" @@ -4176,7 +4239,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddLabels.Output.Ok.Body + let body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4186,7 +4249,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + [Components.Schemas.IssueFieldValue].self, from: responseBody, transforming: { value in .json(value) @@ -4196,13 +4259,14 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 301: + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.MovedPermanently.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { @@ -4214,13 +4278,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 .movedPermanently(.init(body: body)) - case 404: + return .badRequest(.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: [ @@ -4239,10 +4311,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 410: + return .forbidden(.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: [ @@ -4261,7 +4333,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .notFound(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -4284,6 +4356,28 @@ 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: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4296,74 +4390,51 @@ public struct Client: APIProtocol { } ) } - /// Set labels for an issue + /// Delete an issue field value from an issue /// - /// Removes any previous labels and sets the new labels for an issue. + /// Remove a specific custom field value from 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 func issuesSetLabels(_ input: Operations.IssuesSetLabels.Input) async throws -> Operations.IssuesSetLabels.Output { + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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.IssuesSetLabels.id, + forOperation: Operations.IssuesDeleteIssueFieldValue.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, - input.path.issueNumber + input.path.issueNumber, + input.path.issueFieldId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + 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: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - 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: + case 204: + return .noContent(.init()) + 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: [ @@ -4382,7 +4453,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 @@ -4405,9 +4476,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: [ @@ -4417,7 +4488,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) @@ -4426,10 +4497,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - case 422: + return .unprocessableContent(.init(body: body)) + case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4439,7 +4510,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4448,7 +4519,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4461,16 +4532,16 @@ public struct Client: APIProtocol { } ) } - /// Remove all labels from an issue + /// List labels for an issue /// - /// Removes all labels from an issue. + /// Lists all 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 func issuesRemoveAllLabels(_ input: Operations.IssuesRemoveAllLabels.Input) async throws -> Operations.IssuesRemoveAllLabels.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.IssuesRemoveAllLabels.id, + forOperation: Operations.IssuesListLabelsOnIssue.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/issues/{}/labels", @@ -4482,9 +4553,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 @@ -4493,8 +4578,36 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + 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 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 301: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.MovedPermanently.Body @@ -4573,42 +4686,52 @@ public struct Client: APIProtocol { } ) } - /// Remove a label from an issue + /// Add labels to 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. + /// Adds labels to 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 `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.IssuesRemoveLabel.id, + forOperation: Operations.IssuesAddLabels.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: .post ) 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.IssuesRemoveLabel.Output.Ok.Body + let body: Operations.IssuesAddLabels.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4694,6 +4817,28 @@ 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, @@ -4706,21 +4851,19 @@ public struct Client: APIProtocol { } ) } - /// Lock an issue - /// - /// Users with push access can lock an issue or pull request's conversation. + /// Set labels for 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)." + /// Removes any previous labels and sets the new labels for 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 `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.IssuesLock.id, + 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, @@ -4751,11 +4894,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.IssuesSetLabels.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4765,7 +4906,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) @@ -4774,10 +4915,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: [ @@ -4796,7 +4937,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 @@ -4819,6 +4960,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 @@ -4853,19 +5016,19 @@ public struct Client: APIProtocol { } ) } - /// Unlock an issue + /// Remove all labels from an issue /// - /// Users with push access can unlock an issue's conversation. + /// Removes all labels from 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 { + /// - 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.IssuesUnlock.id, + forOperation: Operations.IssuesRemoveAllLabels.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/lock", + template: "/repos/{}/{}/issues/{}/labels", parameters: [ input.path.owner, input.path.repo, @@ -4887,9 +5050,9 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - 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: [ @@ -4908,7 +5071,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 @@ -4931,6 +5094,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, @@ -4943,35 +5128,29 @@ 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 a label 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 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 `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/{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.IssuesGetParent.id, + forOperation: Operations.IssuesRemoveLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/parent", + 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( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4984,7 +5163,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetParent.Output.Ok.Body + let body: Operations.IssuesRemoveLabel.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4994,7 +5173,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) @@ -5082,27 +5261,21 @@ public struct Client: APIProtocol { } ) } - /// Remove sub-issue + /// Lock 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`. + /// Users with push access can lock an issue or pull request's conversation. /// - /// - 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 { + /// 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 `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.IssuesRemoveSubIssue.id, + forOperation: Operations.IssuesLock.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issue", + template: "/repos/{}/{}/issues/{}/lock", parameters: [ input.path.owner, input.path.repo, @@ -5111,7 +5284,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -5120,8 +5293,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" @@ -5131,14 +5306,11 @@ public struct Client: APIProtocol { }, 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 - )) + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesRemoveSubIssue.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5148,7 +5320,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) @@ -5157,18 +5329,14 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 400: + return .forbidden(.init(body: body)) + case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body + let body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json", - "application/scim+json" + "application/json" ] ) switch chosenContentType { @@ -5180,21 +5348,35 @@ public struct Client: APIProtocol { .json(value) } ) - case "application/scim+json": + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.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 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5204,7 +5386,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) @@ -5213,7 +5395,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5226,26 +5408,19 @@ public struct Client: APIProtocol { } ) } - /// List sub-issues - /// - /// You can use the REST API to list the sub-issues on 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). + /// 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 `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 `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.IssuesListSubIssues.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, @@ -5254,23 +5429,9 @@ 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 @@ -5279,14 +5440,11 @@ public struct Client: APIProtocol { }, 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: [ @@ -5296,7 +5454,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) @@ -5305,10 +5463,7 @@ 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 @@ -5331,28 +5486,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, @@ -5365,30 +5498,26 @@ public struct Client: APIProtocol { } ) } - /// Add sub-issue - /// - /// You can use the REST API to add sub-issues to issues. + /// Get parent 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)." + /// 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)." + /// 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 { + /// - 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.IssuesAddSubIssue.id, + forOperation: Operations.IssuesGetParent.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issues", + template: "/repos/{}/{}/issues/{}/parent", parameters: [ input.path.owner, input.path.repo, @@ -5397,34 +5526,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 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 - )) + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesAddSubIssue.Output.Created.Body + let body: Operations.IssuesGetParent.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5443,13 +5558,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init( - headers: headers, - body: body - )) - case 403: + return .ok(.init(body: body)) + 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: [ @@ -5468,10 +5580,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 410: + return .movedPermanently(.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: [ @@ -5490,32 +5602,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - case 422: + return .notFound(.init(body: body)) + case 410: 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 body: Components.Responses.Gone.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5534,7 +5624,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, @@ -5547,19 +5637,27 @@ public struct Client: APIProtocol { } ) } - /// Reprioritize sub-issue + /// Remove sub-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 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 `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 { + /// - 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.IssuesReprioritizeSubIssue.id, + forOperation: Operations.IssuesRemoveSubIssue.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/sub_issues/priority", + template: "/repos/{}/{}/issues/{}/sub_issue", parameters: [ input.path.owner, input.path.repo, @@ -5568,7 +5666,7 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -5589,8 +5687,13 @@ public struct Client: APIProtocol { 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.IssuesReprioritizeSubIssue.Output.Ok.Body + let body: Operations.IssuesRemoveSubIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5609,36 +5712,18 @@ 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: + return .ok(.init( + headers: headers, + body: body + )) + 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 { @@ -5650,35 +5735,21 @@ public struct Client: APIProtocol { .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": + case "application/scim+json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.ScimError.self, from: responseBody, transforming: { value in - .json(value) + .applicationScimJson(value) } ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 503: + return .badRequest(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5688,7 +5759,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5697,7 +5768,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5710,19 +5781,26 @@ public struct Client: APIProtocol { } ) } - /// List timeline events for an issue + /// List sub-issues /// - /// List all timeline events for an issue. + /// You can use the REST API to list the sub-issues on an issue. /// - /// - 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 { + /// 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.IssuesListEventsForTimeline.id, + forOperation: Operations.IssuesListSubIssues.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/issues/{}/timeline", + template: "/repos/{}/{}/issues/{}/sub_issues", parameters: [ input.path.owner, input.path.repo, @@ -5757,13 +5835,13 @@ public struct Client: APIProtocol { 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.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.IssuesListEventsForTimeline.Output.Ok.Body + let body: Operations.IssuesListSubIssues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5773,7 +5851,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) @@ -5842,59 +5920,66 @@ public struct Client: APIProtocol { } ) } - /// List labels for a repository + /// Add sub-issue /// - /// Lists all labels for a repository. + /// You can use the REST API to add sub-issues to issues. /// - /// - 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 { + /// 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.IssuesListLabelsForRepo.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( 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.IssuesListLabelsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + case 201: + let headers: Operations.IssuesAddSubIssue.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.IssuesListLabelsForRepo.Output.Ok.Body + let body: Operations.IssuesAddSubIssue.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5904,7 +5989,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) @@ -5913,13 +5998,13 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( + return .created(.init( headers: headers, 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: [ @@ -5938,40 +6023,107 @@ 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 .forbidden(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } } ) } - /// Create a label + /// Reprioritize 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 reprioritize a sub-issue to a different position in the parent list. /// - /// - 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 { + /// - 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.IssuesCreateLabel.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.repo, + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -5991,14 +6143,9 @@ 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( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesCreateLabel.Output.Created.Body + let body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6008,7 +6155,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) @@ -6017,13 +6164,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init( - headers: headers, - body: body - )) - case 422: + return .ok(.init(body: body)) + 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: [ @@ -6033,7 +6177,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) @@ -6042,7 +6186,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -6065,6 +6209,50 @@ 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.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, @@ -6077,23 +6265,23 @@ public struct Client: APIProtocol { } ) } - /// Get a label + /// List timeline events for an issue /// - /// Gets a label using the given name. + /// List all timeline events for an issue. /// - /// - 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 { + /// - 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.IssuesGetLabel.id, + forOperation: Operations.IssuesListEventsForTimeline.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/labels/{}", + template: "/repos/{}/{}/issues/{}/timeline", parameters: [ input.path.owner, input.path.repo, - input.path.name + input.path.issueNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6101,6 +6289,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 @@ -6110,8 +6312,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + 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.IssuesGetLabel.Output.Ok.Body + let body: Operations.IssuesListEventsForTimeline.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6121,7 +6328,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Label.self, + [Components.Schemas.TimelineIssueEvents].self, from: responseBody, transforming: { value in .json(value) @@ -6130,7 +6337,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 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -6153,6 +6363,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, @@ -6165,52 +6397,59 @@ public struct Client: APIProtocol { } ) } - /// Update a label + /// List labels for a repository /// - /// Updates a label using the given label name. + /// Lists all labels for a repository. /// - /// - 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 `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.IssuesUpdateLabel.id, + forOperation: Operations.IssuesListLabelsForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/labels/{}", + template: "/repos/{}/{}/labels", parameters: [ input.path.owner, - input.path.repo, - input.path.name + 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.IssuesListLabelsForRepo.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.IssuesUpdateLabel.Output.Ok.Body + let body: Operations.IssuesListLabelsForRepo.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6220,154 +6459,7 @@ public struct Client: APIProtocol { 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, + [Components.Schemas.Label].self, from: responseBody, transforming: { value in .json(value) @@ -6414,19 +6506,19 @@ public struct Client: APIProtocol { } ) } - /// Create a milestone + /// Create a label /// - /// Creates a milestone. + /// 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}/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 `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.IssuesCreateMilestone.id, + forOperation: Operations.IssuesCreateLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones", + template: "/repos/{}/{}/labels", parameters: [ input.path.owner, input.path.repo @@ -6455,13 +6547,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 201: - let headers: Operations.IssuesCreateMilestone.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + 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: [ @@ -6471,7 +6563,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) @@ -6484,9 +6576,9 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 404: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6496,7 +6588,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) @@ -6505,10 +6597,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .unprocessableContent(.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: [ @@ -6518,7 +6610,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) @@ -6527,7 +6619,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6540,23 +6632,23 @@ public struct Client: APIProtocol { } ) } - /// Get a milestone + /// Get a label /// - /// Gets a milestone using the given milestone number. + /// Gets a label using the given name. /// - /// - 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 { + /// - 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.IssuesGetMilestone.id, + forOperation: Operations.IssuesGetLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", + template: "/repos/{}/{}/labels/{}", parameters: [ input.path.owner, input.path.repo, - input.path.milestoneNumber + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6574,7 +6666,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesGetMilestone.Output.Ok.Body + let body: Operations.IssuesGetLabel.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6584,7 +6676,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) @@ -6628,23 +6720,23 @@ public struct Client: APIProtocol { } ) } - /// Update a milestone - /// + /// Update a label /// + /// Updates a label using the given label name. /// - /// - 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 { + /// - 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.IssuesUpdateMilestone.id, + forOperation: Operations.IssuesUpdateLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", + template: "/repos/{}/{}/labels/{}", parameters: [ input.path.owner, input.path.repo, - input.path.milestoneNumber + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6673,7 +6765,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesUpdateMilestone.Output.Ok.Body + let body: Operations.IssuesUpdateLabel.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6683,7 +6775,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) @@ -6705,23 +6797,23 @@ public struct Client: APIProtocol { } ) } - /// Delete a milestone + /// Delete a label /// - /// Deletes a milestone using the given milestone number. + /// Deletes a label using the given label name. /// - /// - 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 { + /// - 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.IssuesDeleteMilestone.id, + forOperation: Operations.IssuesDeleteLabel.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}", + template: "/repos/{}/{}/labels/{}", parameters: [ input.path.owner, input.path.repo, - input.path.milestoneNumber + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6729,67 +6821,40 @@ 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)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) } } ) } - /// List labels for issues in a milestone + /// List milestones /// - /// Lists labels for issues in a milestone. + /// Lists milestones for a repository. /// - /// - 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 { + /// - 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.IssuesListLabelsForMilestone.id, + forOperation: Operations.IssuesListMilestones.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/milestones/{}/labels", + template: "/repos/{}/{}/milestones", parameters: [ input.path.owner, - input.path.repo, - input.path.milestoneNumber + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6797,6 +6862,27 @@ 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, @@ -6820,13 +6906,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.IssuesListLabelsForMilestone.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + 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.IssuesListLabelsForMilestone.Output.Ok.Body + let body: Operations.IssuesListMilestones.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6836,7 +6922,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Label].self, + [Components.Schemas.Milestone].self, from: responseBody, transforming: { value in .json(value) @@ -6849,6 +6935,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, @@ -6861,34 +6969,22 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Create a milestone /// - /// 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)." + /// Creates a milestone. /// - /// - 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 { + /// - 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.IssuesAddIssueFieldValues.id, + forOperation: Operations.IssuesCreateMilestone.id, serializer: { input in let path = try converter.renderedPath( - template: "/repositories/{}/issues/{}/issue-field-values", + template: "/repos/{}/{}/milestones", parameters: [ - input.path.repositoryId, - input.path.issueNumber + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6913,62 +7009,14 @@ public struct Client: APIProtocol { }, 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: + 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: Components.Responses.Forbidden.Body + let body: Operations.IssuesCreateMilestone.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6978,7 +7026,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.Milestone.self, from: responseBody, transforming: { value in .json(value) @@ -6987,7 +7035,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .created(.init( + headers: headers, + body: body + )) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -7032,28 +7083,6 @@ 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: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7066,62 +7095,41 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Get a milestone /// - /// 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)." + /// Gets a milestone using the given milestone number. /// - /// - 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 { + /// - 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.IssuesSetIssueFieldValues.id, + forOperation: Operations.IssuesGetMilestone.id, serializer: { input in let path = try converter.renderedPath( - template: "/repositories/{}/issues/{}/issue-field-values", + template: "/repos/{}/{}/milestones/{}", parameters: [ - input.path.repositoryId, - input.path.issueNumber + input.path.owner, + input.path.repo, + input.path.milestoneNumber ] ) 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 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body + let body: Operations.IssuesGetMilestone.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7131,7 +7139,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.IssueFieldValue].self, + Components.Schemas.Milestone.self, from: responseBody, transforming: { value in .json(value) @@ -7141,14 +7149,13 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 400: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json", - "application/scim+json" + "application/json" ] ) switch chosenContentType { @@ -7160,87 +7167,68 @@ 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 .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) - } + return .notFound(.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 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" - ] + } + } + ) + } + /// 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" ) - 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: + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Operations.IssuesUpdateMilestone.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7250,7 +7238,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.Milestone.self, from: responseBody, transforming: { value in .json(value) @@ -7259,7 +7247,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7272,30 +7260,23 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Delete a milestone /// - /// 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)." + /// Deletes a milestone using the given milestone number. /// - /// - 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 { + /// - 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.IssuesDeleteIssueFieldValue.id, + forOperation: Operations.IssuesDeleteMilestone.id, serializer: { input in let path = try converter.renderedPath( - template: "/repositories/{}/issues/{}/issue-field-values/{}", + template: "/repos/{}/{}/milestones/{}", parameters: [ - input.path.repositoryId, - input.path.issueNumber, - input.path.issueFieldId + input.path.owner, + input.path.repo, + input.path.milestoneNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7313,28 +7294,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 @@ -7357,31 +7316,72 @@ 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: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 503: + ) + } + } + ) + } + /// 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: Components.Responses.ServiceUnavailable.Body + let body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7391,7 +7391,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + [Components.Schemas.Label].self, from: responseBody, transforming: { value in .json(value) @@ -7400,7 +7400,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 8e395b11895..17056b337a1 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -358,6 +358,59 @@ public protocol APIProtocol: Sendable { /// - 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 + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 labels for an issue /// /// Lists all labels for an issue. @@ -561,59 +614,6 @@ 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. @@ -1226,6 +1226,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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 labels for an issue /// /// Lists all labels for an issue. @@ -1647,87 +1728,6 @@ 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. @@ -9414,10 +9414,6 @@ 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`. @@ -16990,28 +16986,40 @@ public enum Operations { } } } - /// List labels for an issue + /// Add issue field values to an issue /// - /// Lists all labels for 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. /// - /// - 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/GET/path`. + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -17029,84 +17037,164 @@ 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 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 var path: Operations.IssuesAddIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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.IssuesListLabelsOnIssue.Input.Headers + public var headers: Operations.IssuesAddIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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: - /// - query: /// - headers: + /// - body: public init( - path: Operations.IssuesListLabelsOnIssue.Input.Path, - query: Operations.IssuesListLabelsOnIssue.Input.Query = .init(), - headers: Operations.IssuesListLabelsOnIssue.Input.Headers = .init() + path: Operations.IssuesAddIssueFieldValues.Input.Path, + headers: Operations.IssuesAddIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesAddIssueFieldValues.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/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/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.Label] { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -17116,31 +17204,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body + public var body: Operations.IssuesAddIssueFieldValues.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 - ) { - self.headers = headers + public init(body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body) { self.body = body } } /// 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/post(issues/add-issue-field-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListLabelsOnIssue.Output.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.IssuesListLabelsOnIssue.Output.Ok { + public var ok: Operations.IssuesAddIssueFieldValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -17153,24 +17236,47 @@ public enum Operations { } } } - /// Moved permanently + /// Bad Request /// - /// - 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/post(issues/add-issue-field-values)/responses/400`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .movedPermanently(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 ) } @@ -17178,7 +17284,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/post(issues/add-issue-field-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -17199,24 +17305,47 @@ public enum Operations { } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - 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/post(issues/add-issue-field-values)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// 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 `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 ) } @@ -17229,11 +17358,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) } @@ -17244,37 +17376,53 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Add labels to an issue + /// Set issue field values for an issue /// - /// Adds labels to 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. /// - /// - 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" + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -17292,104 +17440,137 @@ 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.IssuesSetIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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.IssuesAddLabels.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody`. + public var headers: Operations.IssuesSetIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/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 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}/issue-field-values/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. - public var labels: [Swift.String]? - /// Creates a new `Case1Payload`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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 /// - /// - Parameters: - /// - 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 - } - public enum CodingKeys: String, CodingKey { - case labels + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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) + } + } } - } - /// - 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/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 `Case3PayloadPayload`. + /// 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/repos/{owner}/{repo}/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: - /// - name: - public init(name: Swift.String) { - self.name = name + /// - 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 name - } - } - /// - 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 - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + case fieldId = "field_id" + case value } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + 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" + ]) } - 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 encoder.encodeToSingleValueContainer(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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/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/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddLabels.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload) } - public var body: Operations.IssuesAddLabels.Input.Body? + public var body: Operations.IssuesSetIssueFieldValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -17397,9 +17578,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesAddLabels.Input.Path, - headers: Operations.IssuesAddLabels.Input.Headers = .init(), - body: Operations.IssuesAddLabels.Input.Body? = nil + path: Operations.IssuesSetIssueFieldValues.Input.Path, + headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesSetIssueFieldValues.Input.Body ) { self.path = path self.headers = headers @@ -17408,15 +17589,15 @@ 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/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/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]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.Label] { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -17426,26 +17607,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddLabels.Output.Ok.Body + public var body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesAddLabels.Output.Ok.Body) { + public init(body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body) { 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}/issue-field-values/put(issues/set-issue-field-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesAddLabels.Output.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.IssuesAddLabels.Output.Ok { + public var ok: Operations.IssuesSetIssueFieldValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -17458,70 +17639,70 @@ public enum Operations { } } } - /// Moved permanently + /// Bad Request /// - /// - 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}/issue-field-values/put(issues/set-issue-field-values)/responses/400`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .movedPermanently(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Forbidden /// - /// - 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}/issue-field-values/put(issues/set-issue-field-values)/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(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .notFound(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "forbidden", response: self ) } } } - /// Gone + /// Resource not found /// - /// - 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}/issue-field-values/put(issues/set-issue-field-values)/responses/404`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// 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 `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .gone(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "notFound", response: self ) } @@ -17529,7 +17710,7 @@ 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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -17550,6 +17731,29 @@ public enum Operations { } } } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-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. @@ -17557,11 +17761,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) } @@ -17572,298 +17779,159 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Set labels for an issue + /// Delete an issue field value from an issue /// - /// Removes any previous labels and sets the new labels for an issue. + /// Remove a specific custom field value from 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" + /// 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 /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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}/issues/{issue_number}/labels/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_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}/labels/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/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. /// - issueNumber: The number that identifies the issue. + /// - issueFieldId: The unique identifier of the issue field. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + issueNumber: Components.Parameters.IssueNumber, + issueFieldId: Components.Parameters.IssueFieldId ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber + self.issueFieldId = issueFieldId } } - public var path: Operations.IssuesSetLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/header`. + public var path: Operations.IssuesDeleteIssueFieldValue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.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 - } + public var headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesDeleteIssueFieldValue.Input.Path, + headers: Operations.IssuesDeleteIssueFieldValue.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() {} + } + /// Issue field value deleted successfully + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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//repos/{owner}/{repo}/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 + ) } - /// - 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`. - /// - /// - 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/put(issues/set-labels)/responses/200`. - /// - /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesSetLabels.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}/labels/put(issues/set-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 - ) + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/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 + ) } } } /// 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}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -17884,47 +17952,47 @@ public enum Operations { } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - 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}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// 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 `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Service unavailable /// - /// - 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}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/503`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .unprocessableContent(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "serviceUnavailable", response: self ) } @@ -17961,28 +18029,28 @@ public enum Operations { } } } - /// Remove all labels from an issue + /// List labels for an issue /// - /// Removes all labels from an issue. + /// Lists all 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 `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/DELETE/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/DELETE/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/DELETE/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/DELETE/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`. /// @@ -18000,63 +18068,125 @@ 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.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.IssuesRemoveAllLabels.Input.Headers + public var headers: Operations.IssuesListLabelsOnIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesRemoveAllLabels.Input.Path, - headers: Operations.IssuesRemoveAllLabels.Input.Headers = .init() + 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 } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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`. + public var json: [Components.Schemas.Label] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response 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( + 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/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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/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.IssuesListLabelsOnIssue.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.IssuesListLabelsOnIssue.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 ) } @@ -18064,7 +18194,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/get(issues/list-labels-on-issue)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -18087,7 +18217,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/get(issues/list-labels-on-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -18110,7 +18240,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/get(issues/list-labels-on-issue)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -18162,81 +18292,164 @@ public enum Operations { } } } - /// Remove a label from an issue + /// Add labels to 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. + /// Adds labels to 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 `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/{name}/DELETE/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/{name}/DELETE/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/{name}/DELETE/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/{name}/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/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 - self.name = name } } - public var path: Operations.IssuesRemoveLabel.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/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.IssuesRemoveLabel.Input.Headers + 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 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/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 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 + } + 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/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 `Case3PayloadPayload`. + /// + /// - 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`. + 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 + } 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 value.encode(to: encoder) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(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? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesRemoveLabel.Input.Path, - headers: Operations.IssuesRemoveLabel.Input.Headers = .init() + path: Operations.IssuesAddLabels.Input.Path, + headers: Operations.IssuesAddLabels.Input.Headers = .init(), + body: Operations.IssuesAddLabels.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/{name}/DELETE/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/{name}/DELETE/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`. /// @@ -18252,26 +18465,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesRemoveLabel.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.IssuesRemoveLabel.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/{name}/delete(issues/remove-label)/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.IssuesRemoveLabel.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.IssuesRemoveLabel.Output.Ok { + public var ok: Operations.IssuesAddLabels.Output.Ok { get throws { switch self { case let .ok(response): @@ -18286,7 +18499,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/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) @@ -18309,7 +18522,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/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) @@ -18332,7 +18545,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/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) @@ -18353,255 +18566,9 @@ 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() { - 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 - ] - } - } - } - /// Lock an issue - /// - /// Users with push access can lock an issue or pull request's conversation. - /// - /// 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 `PUT /repos/{owner}/{repo}/issues/{issue_number}/lock`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)`. - public enum IssuesLock { - public static let id: Swift.String = "issues/lock" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/lock/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}/lock/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}/lock/PUT/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.IssuesLock.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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.IssuesLock.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - /// * `off-topic` - /// * `too heated` - /// * `resolved` - /// * `spam` - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. - @frozen public enum LockReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { - case offTopic = "off-topic" - case tooHeated = "too heated" - case resolved = "resolved" - case spam = "spam" - } - /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - /// * `off-topic` - /// * `too heated` - /// * `resolved` - /// * `spam` - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. - public var lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - lockReason: The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - public init(lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? = nil) { - self.lockReason = lockReason - } - public enum CodingKeys: String, CodingKey { - case lockReason = "lock_reason" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/content/application\/json`. - case json(Operations.IssuesLock.Input.Body.JsonPayload) - } - public var body: Operations.IssuesLock.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.IssuesLock.Input.Path, - headers: Operations.IssuesLock.Input.Headers = .init(), - body: Operations.IssuesLock.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//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesLock.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/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.IssuesLock.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}/issues/{issue_number}/lock/put(issues/lock)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/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) @@ -18653,28 +18620,28 @@ public enum Operations { } } } - /// 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 enum IssuesUnlock { - public static let id: Swift.String = "issues/unlock" + /// - 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}/lock/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}/lock/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}/lock/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}/lock/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`. /// @@ -18692,86 +18659,242 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesUnlock.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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.IssuesUnlock.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.IssuesUnlock.Input.Path, - headers: Operations.IssuesUnlock.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}/lock/delete(issues/unlock)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesUnlock.Output.NoContent) + 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`. + /// + /// - 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}/lock/delete(issues/unlock)/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.IssuesUnlock.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 ) } } } - /// Forbidden + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/301`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// 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 `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .forbidden(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "movedPermanently", response: self ) } @@ -18779,7 +18902,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/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) @@ -18800,6 +18923,52 @@ public enum Operations { } } } + /// Gone + /// + /// - 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) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/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. @@ -18831,35 +19000,28 @@ public enum Operations { } } } - /// 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 enum IssuesGetParent { - public static let id: Swift.String = "issues/get-parent" + /// - 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}/parent/GET/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}/parent/GET/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}/parent/GET/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}/parent/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -18877,79 +19039,63 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesGetParent.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/header`. + 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] + 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.IssuesGetParent.Input.Headers + public var headers: Operations.IssuesRemoveAllLabels.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesGetParent.Input.Path, - headers: Operations.IssuesGetParent.Input.Headers = .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 Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Issue) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesGetParent.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesGetParent.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/{issue_number}/parent/get(issues/get-parent)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetParent.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesRemoveAllLabels.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesGetParent.Output.Ok { + /// - 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 .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -18957,7 +19103,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. + /// - 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) @@ -18980,7 +19126,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. + /// - 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) @@ -19003,7 +19149,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. + /// - 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) @@ -19055,130 +19201,87 @@ public enum Operations { } } } - /// 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 enum IssuesRemoveSubIssue { - public static let id: Swift.String = "issues/remove-sub-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" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path`. + /// - 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}/sub_issue/DELETE/path/owner`. + /// - 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}/sub_issue/DELETE/path/repo`. + /// - 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}/sub_issue/DELETE/path/issue_number`. + /// - 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 + issueNumber: Components.Parameters.IssueNumber, + name: Swift.String ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber + self.name = name } } - public var path: Operations.IssuesRemoveSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/header`. + public var path: Operations.IssuesRemoveLabel.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the sub-issue to remove - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. - public var subIssueId: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subIssueId: The id of the sub-issue to remove - public init(subIssueId: Swift.Int) { - self.subIssueId = subIssueId - } - public enum CodingKeys: String, CodingKey { - case subIssueId = "sub_issue_id" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/content/application\/json`. - case json(Operations.IssuesRemoveSubIssue.Input.Body.JsonPayload) - } - public var body: Operations.IssuesRemoveSubIssue.Input.Body + public var headers: Operations.IssuesRemoveLabel.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.IssuesRemoveSubIssue.Input.Path, - headers: Operations.IssuesRemoveSubIssue.Input.Headers = .init(), - body: Operations.IssuesRemoveSubIssue.Input.Body + path: Operations.IssuesRemoveLabel.Input.Path, + headers: Operations.IssuesRemoveLabel.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/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/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.IssuesRemoveSubIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/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.Issue { + public var json: [Components.Schemas.Label] { get throws { switch self { case let .json(body): @@ -19188,31 +19291,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesRemoveSubIssue.Output.Ok.Body + public var body: Operations.IssuesRemoveLabel.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(), - body: Operations.IssuesRemoveSubIssue.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesRemoveLabel.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesRemoveSubIssue.Output.Ok) + case ok(Operations.IssuesRemoveLabel.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.IssuesRemoveSubIssue.Output.Ok { + public var ok: Operations.IssuesRemoveLabel.Output.Ok { get throws { switch self { case let .ok(response): @@ -19225,24 +19323,24 @@ public enum Operations { } } } - /// Bad Request + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/400`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/301`. /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. + /// 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 `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .badRequest(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", + expectedStatus: "movedPermanently", response: self ) } @@ -19250,7 +19348,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19271,6 +19369,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/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. @@ -19278,14 +19399,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) } @@ -19296,47 +19414,39 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// List 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 enum IssuesListSubIssues { - public static let id: Swift.String = "issues/list-sub-issues" + /// - 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 enum IssuesLock { + public static let id: Swift.String = "issues/lock" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -19354,125 +19464,152 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListSubIssues.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/sub_issues/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}/sub_issues/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.IssuesListSubIssues.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/header`. + public var path: Operations.IssuesLock.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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.IssuesListSubIssues.Input.Headers + public var headers: Operations.IssuesLock.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + /// * `off-topic` + /// * `too heated` + /// * `resolved` + /// * `spam` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. + @frozen public enum LockReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case offTopic = "off-topic" + case tooHeated = "too heated" + case resolved = "resolved" + case spam = "spam" + } + /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + /// * `off-topic` + /// * `too heated` + /// * `resolved` + /// * `spam` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. + public var lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - lockReason: The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + public init(lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? = nil) { + self.lockReason = lockReason + } + public enum CodingKeys: String, CodingKey { + case lockReason = "lock_reason" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesLock.Input.Body.JsonPayload) + } + public var body: Operations.IssuesLock.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.IssuesListSubIssues.Input.Path, - query: Operations.IssuesListSubIssues.Input.Query = .init(), - headers: Operations.IssuesListSubIssues.Input.Headers = .init() + path: Operations.IssuesLock.Input.Path, + headers: Operations.IssuesLock.Input.Headers = .init(), + body: Operations.IssuesLock.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesLock.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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 + /// 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.IssuesLock.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.IssuesListSubIssues.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Issue]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Issue] { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/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.IssuesListSubIssues.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListSubIssues.Output.Ok.Headers = .init(), - body: Operations.IssuesListSubIssues.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } } - /// Response + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/410`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListSubIssues.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListSubIssues.Output.Ok { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .ok(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "gone", response: self ) } @@ -19480,7 +19617,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19501,24 +19638,24 @@ public enum Operations { } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// 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 `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", response: self ) } @@ -19555,39 +19692,28 @@ public enum Operations { } } } - /// 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 enum IssuesAddSubIssue { - public static let id: Swift.String = "issues/add-sub-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 enum IssuesUnlock { + public static let id: Swift.String = "issues/unlock" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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}/sub_issues/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -19605,134 +19731,63 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesAddSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/header`. + public var path: Operations.IssuesUnlock.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/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.IssuesAddSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. - public var subIssueId: Swift.Int - /// Option that, when true, instructs the operation to replace the sub-issues current parent issue - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/replace_parent`. - public var replaceParent: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subIssueId: The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue - /// - replaceParent: Option that, when true, instructs the operation to replace the sub-issues current parent issue - public init( - subIssueId: Swift.Int, - replaceParent: Swift.Bool? = nil - ) { - self.subIssueId = subIssueId - self.replaceParent = replaceParent - } - public enum CodingKeys: String, CodingKey { - case subIssueId = "sub_issue_id" - case replaceParent = "replace_parent" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddSubIssue.Input.Body.JsonPayload) - } - public var body: Operations.IssuesAddSubIssue.Input.Body + public var headers: Operations.IssuesUnlock.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: - public init( - path: Operations.IssuesAddSubIssue.Input.Path, - headers: Operations.IssuesAddSubIssue.Input.Headers = .init(), - body: Operations.IssuesAddSubIssue.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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.IssuesAddSubIssue.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Issue) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesAddSubIssue.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(), - body: Operations.IssuesAddSubIssue.Output.Created.Body - ) { - self.headers = headers - self.body = body - } + public init( + path: Operations.IssuesUnlock.Input.Path, + headers: Operations.IssuesUnlock.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}/sub_issues/post(issues/add-sub-issue)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesAddSubIssue.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesUnlock.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.IssuesAddSubIssue.Output.Created { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/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.IssuesUnlock.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 ) } @@ -19740,7 +19795,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -19761,55 +19816,9 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-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 - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19861,28 +19870,35 @@ public enum Operations { } } } - /// 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 enum IssuesReprioritizeSubIssue { - public static let id: Swift.String = "issues/reprioritize-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). + /// + /// - **`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 enum IssuesGetParent { + public static let id: Swift.String = "issues/get-parent" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/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}/sub_issues/priority/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/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}/sub_issues/priority/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/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}/sub_issues/priority/PATCH/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -19900,81 +19916,37 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesReprioritizeSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/header`. + public var path: Operations.IssuesGetParent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/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.IssuesReprioritizeSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the sub-issue to reprioritize - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/sub_issue_id`. - public var subIssueId: Swift.Int - /// The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/after_id`. - public var afterId: Swift.Int? - /// The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/before_id`. - public var beforeId: Swift.Int? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subIssueId: The id of the sub-issue to reprioritize - /// - afterId: The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). - /// - beforeId: The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). - public init( - subIssueId: Swift.Int, - afterId: Swift.Int? = nil, - beforeId: Swift.Int? = nil - ) { - self.subIssueId = subIssueId - self.afterId = afterId - self.beforeId = beforeId - } - public enum CodingKeys: String, CodingKey { - case subIssueId = "sub_issue_id" - case afterId = "after_id" - case beforeId = "before_id" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesReprioritizeSubIssue.Input.Body.JsonPayload) - } - public var body: Operations.IssuesReprioritizeSubIssue.Input.Body + public var headers: Operations.IssuesGetParent.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.IssuesReprioritizeSubIssue.Input.Path, - headers: Operations.IssuesReprioritizeSubIssue.Input.Headers = .init(), - body: Operations.IssuesReprioritizeSubIssue.Input.Body + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.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/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// @@ -19990,26 +19962,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body + public var body: Operations.IssuesGetParent.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body) { + public init(body: Operations.IssuesGetParent.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesReprioritizeSubIssue.Output.Ok) + case ok(Operations.IssuesGetParent.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.IssuesReprioritizeSubIssue.Output.Ok { + public var ok: Operations.IssuesGetParent.Output.Ok { get throws { switch self { case let .ok(response): @@ -20022,24 +19994,24 @@ public enum Operations { } } } - /// Forbidden + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// 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 `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .forbidden(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "movedPermanently", response: self ) } @@ -20047,7 +20019,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20068,47 +20040,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/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 - ) - } - } - } - /// Service unavailable + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// 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 `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .serviceUnavailable(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "gone", response: self ) } @@ -20145,28 +20094,36 @@ public enum Operations { } } } - /// 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 enum IssuesListEventsForTimeline { - public static let id: Swift.String = "issues/list-events-for-timeline" + /// - 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 enum IssuesRemoveSubIssue { + public static let id: Swift.String = "issues/remove-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/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}/timeline/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/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}/timeline/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/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}/timeline/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -20184,84 +20141,83 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListEventsForTimeline.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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}/timeline/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}/timeline/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.IssuesListEventsForTimeline.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/header`. + public var path: Operations.IssuesRemoveSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/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.IssuesListEventsForTimeline.Input.Headers + public var headers: Operations.IssuesRemoveSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The id of the sub-issue to remove + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. + public var subIssueId: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subIssueId: The id of the sub-issue to remove + public init(subIssueId: Swift.Int) { + self.subIssueId = subIssueId + } + public enum CodingKeys: String, CodingKey { + case subIssueId = "sub_issue_id" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/content/application\/json`. + case json(Operations.IssuesRemoveSubIssue.Input.Body.JsonPayload) + } + public var body: Operations.IssuesRemoveSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.IssuesListEventsForTimeline.Input.Path, - query: Operations.IssuesListEventsForTimeline.Input.Query = .init(), - headers: Operations.IssuesListEventsForTimeline.Input.Headers = .init() + path: Operations.IssuesRemoveSubIssue.Input.Path, + headers: Operations.IssuesRemoveSubIssue.Input.Headers = .init(), + body: Operations.IssuesRemoveSubIssue.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers/Location`. + public var location: Swift.String? /// Creates a new `Headers`. /// /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link + /// - location: + public init(location: Swift.String? = nil) { + self.location = location } } /// Received HTTP response headers - public var headers: Operations.IssuesListEventsForTimeline.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/content`. + public var headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TimelineIssueEvents]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.TimelineIssueEvents] { + public var json: Components.Schemas.Issue { get throws { switch self { case let .json(body): @@ -20271,15 +20227,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListEventsForTimeline.Output.Ok.Body + public var body: Operations.IssuesRemoveSubIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListEventsForTimeline.Output.Ok.Headers = .init(), - body: Operations.IssuesListEventsForTimeline.Output.Ok.Body + headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesRemoveSubIssue.Output.Ok.Body ) { self.headers = headers self.body = body @@ -20287,15 +20243,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListEventsForTimeline.Output.Ok) + case ok(Operations.IssuesRemoveSubIssue.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.IssuesListEventsForTimeline.Output.Ok { + public var ok: Operations.IssuesRemoveSubIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -20308,47 +20264,47 @@ public enum Operations { } } } - /// Resource not found + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/400`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .notFound(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "badRequest", response: self ) } } } - /// Gone + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/404`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// 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 `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .gone(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "notFound", response: self ) } @@ -20361,11 +20317,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) } @@ -20376,57 +20335,74 @@ 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 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 enum IssuesListLabelsForRepo { - public static let id: Swift.String = "issues/list-labels-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 `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 enum IssuesListSubIssues { + public static let id: Swift.String = "issues/list-sub-issues" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/sub_issues/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 + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo + self.issueNumber = issueNumber } } - public var path: Operations.IssuesListLabelsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/query`. + public var path: Operations.IssuesListSubIssues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -20441,19 +20417,19 @@ public enum Operations { self.page = page } } - public var query: Operations.IssuesListLabelsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/header`. + public var query: Operations.IssuesListSubIssues.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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.IssuesListLabelsForRepo.Input.Headers + public var headers: Operations.IssuesListSubIssues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -20461,9 +20437,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListLabelsForRepo.Input.Path, - query: Operations.IssuesListLabelsForRepo.Input.Query = .init(), - headers: Operations.IssuesListLabelsForRepo.Input.Headers = .init() + path: Operations.IssuesListSubIssues.Input.Path, + query: Operations.IssuesListSubIssues.Input.Query = .init(), + headers: Operations.IssuesListSubIssues.Input.Headers = .init() ) { self.path = path self.query = query @@ -20472,9 +20448,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -20485,16 +20461,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/content`. + public var headers: Operations.IssuesListSubIssues.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Label] { + public var json: [Components.Schemas.Issue] { get throws { switch self { case let .json(body): @@ -20504,15 +20480,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListLabelsForRepo.Output.Ok.Body + public var body: Operations.IssuesListSubIssues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers = .init(), - body: Operations.IssuesListLabelsForRepo.Output.Ok.Body + headers: Operations.IssuesListSubIssues.Output.Ok.Headers = .init(), + body: Operations.IssuesListSubIssues.Output.Ok.Body ) { self.headers = headers self.body = body @@ -20520,15 +20496,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListLabelsForRepo.Output.Ok) + case ok(Operations.IssuesListSubIssues.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.IssuesListLabelsForRepo.Output.Ok { + public var ok: Operations.IssuesListSubIssues.Output.Ok { get throws { switch self { case let .ok(response): @@ -20543,7 +20519,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20564,6 +20540,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/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. @@ -20595,92 +20594,102 @@ public enum Operations { } } } - /// 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 enum IssuesCreateLabel { - public static let id: Swift.String = "issues/create-label" + /// 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 enum IssuesAddSubIssue { + public static let id: Swift.String = "issues/add-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/labels/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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}/sub_issues/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo + self.issueNumber = issueNumber } } - public var path: Operations.IssuesCreateLabel.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/header`. + public var path: Operations.IssuesAddSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/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.IssuesCreateLabel.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody`. + public var headers: Operations.IssuesAddSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/name`. - public var name: Swift.String - /// The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + /// The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/color`. - public var color: Swift.String? - /// A short description of the label. Must be 100 characters or fewer. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. + public var subIssueId: Swift.Int + /// Option that, when true, instructs the operation to replace the sub-issues current parent issue /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/description`. - public var description: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/replace_parent`. + public var replaceParent: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." - /// - color: The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. - /// - description: A short description of the label. Must be 100 characters or fewer. + /// - subIssueId: The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue + /// - replaceParent: Option that, when true, instructs the operation to replace the sub-issues current parent issue public init( - name: Swift.String, - color: Swift.String? = nil, - description: Swift.String? = nil + subIssueId: Swift.Int, + replaceParent: Swift.Bool? = nil ) { - self.name = name - self.color = color - self.description = description + self.subIssueId = subIssueId + self.replaceParent = replaceParent } public enum CodingKeys: String, CodingKey { - case name - case color - case description + case subIssueId = "sub_issue_id" + case replaceParent = "replace_parent" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/content/application\/json`. - case json(Operations.IssuesCreateLabel.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddSubIssue.Input.Body.JsonPayload) } - public var body: Operations.IssuesCreateLabel.Input.Body + public var body: Operations.IssuesAddSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -20688,9 +20697,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesCreateLabel.Input.Path, - headers: Operations.IssuesCreateLabel.Input.Headers = .init(), - body: Operations.IssuesCreateLabel.Input.Body + path: Operations.IssuesAddSubIssue.Input.Path, + headers: Operations.IssuesAddSubIssue.Input.Headers = .init(), + body: Operations.IssuesAddSubIssue.Input.Body ) { self.path = path self.headers = headers @@ -20699,9 +20708,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/headers/Location`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers/Location`. public var location: Swift.String? /// Creates a new `Headers`. /// @@ -20712,16 +20721,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesCreateLabel.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/content`. + public var headers: Operations.IssuesAddSubIssue.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Label) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Label { + public var json: Components.Schemas.Issue { get throws { switch self { case let .json(body): @@ -20731,15 +20740,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesCreateLabel.Output.Created.Body + public var body: Operations.IssuesAddSubIssue.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesCreateLabel.Output.Created.Headers = .init(), - body: Operations.IssuesCreateLabel.Output.Created.Body + headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(), + body: Operations.IssuesAddSubIssue.Output.Created.Body ) { self.headers = headers self.body = body @@ -20747,15 +20756,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.IssuesCreateLabel.Output.Created) + case created(Operations.IssuesAddSubIssue.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.IssuesCreateLabel.Output.Created { + public var created: Operations.IssuesAddSubIssue.Output.Created { get throws { switch self { case let .created(response): @@ -20768,9 +20777,55 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-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 + ) + } + } + } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -20793,7 +20848,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20845,80 +20900,126 @@ public enum Operations { } } } - /// Get a label + /// Reprioritize sub-issue /// - /// Gets a label using the given name. + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)`. - public enum IssuesGetLabel { - public static let id: Swift.String = "issues/get-label" + /// - 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 enum IssuesReprioritizeSubIssue { + public static let id: Swift.String = "issues/reprioritize-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/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}/labels/{name}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/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}/labels/{name}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/repo`. public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/path/name`. - public var name: Swift.String + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/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. - /// - name: + /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - name: Swift.String + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo - self.name = name + self.issueNumber = issueNumber } } - public var path: Operations.IssuesGetLabel.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/header`. + public var path: Operations.IssuesReprioritizeSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/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.IssuesGetLabel.Input.Headers + public var headers: Operations.IssuesReprioritizeSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The id of the sub-issue to reprioritize + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/sub_issue_id`. + public var subIssueId: Swift.Int + /// The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/after_id`. + public var afterId: Swift.Int? + /// The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/before_id`. + public var beforeId: Swift.Int? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subIssueId: The id of the sub-issue to reprioritize + /// - afterId: The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// - beforeId: The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + public init( + subIssueId: Swift.Int, + afterId: Swift.Int? = nil, + beforeId: Swift.Int? = nil + ) { + self.subIssueId = subIssueId + self.afterId = afterId + self.beforeId = beforeId + } + public enum CodingKeys: String, CodingKey { + case subIssueId = "sub_issue_id" + case afterId = "after_id" + case beforeId = "before_id" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesReprioritizeSubIssue.Input.Body.JsonPayload) + } + public var body: Operations.IssuesReprioritizeSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesGetLabel.Input.Path, - headers: Operations.IssuesGetLabel.Input.Headers = .init() + path: Operations.IssuesReprioritizeSubIssue.Input.Path, + headers: Operations.IssuesReprioritizeSubIssue.Input.Headers = .init(), + body: Operations.IssuesReprioritizeSubIssue.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}/labels/{name}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Label) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Label { + public var json: Components.Schemas.Issue { get throws { switch self { case let .json(body): @@ -20928,26 +21029,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGetLabel.Output.Ok.Body + public var body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesGetLabel.Output.Ok.Body) { + public init(body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetLabel.Output.Ok) + case ok(Operations.IssuesReprioritizeSubIssue.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.IssuesGetLabel.Output.Ok { + public var ok: Operations.IssuesReprioritizeSubIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -20960,9 +21061,32 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/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}/labels/{name}/get(issues/get-label)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20983,6 +21107,52 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/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 + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/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. @@ -21014,124 +21184,123 @@ public enum Operations { } } } - /// Update a label + /// List timeline events for an issue /// - /// Updates a label using the given label name. + /// List all timeline events for an issue. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)`. - public enum IssuesUpdateLabel { - public static let id: Swift.String = "issues/update-label" + /// - 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 enum IssuesListEventsForTimeline { + public static let id: Swift.String = "issues/list-events-for-timeline" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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}/labels/{name}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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}/labels/{name}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/path/repo`. public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/path/name`. - public var name: Swift.String + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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. - /// - name: + /// - issueNumber: The number that identifies the issue. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - name: Swift.String + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo - self.name = name + self.issueNumber = issueNumber } } - public var path: Operations.IssuesUpdateLabel.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/header`. + public var path: Operations.IssuesListEventsForTimeline.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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}/timeline/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}/timeline/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.IssuesListEventsForTimeline.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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.IssuesUpdateLabel.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/new_name`. - public var newName: Swift.String? - /// The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/color`. - public var color: Swift.String? - /// A short description of the label. Must be 100 characters or fewer. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/description`. - public var description: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - newName: The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." - /// - color: The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. - /// - description: A short description of the label. Must be 100 characters or fewer. - public init( - newName: Swift.String? = nil, - color: Swift.String? = nil, - description: Swift.String? = nil - ) { - self.newName = newName - self.color = color - self.description = description - } - public enum CodingKeys: String, CodingKey { - case newName = "new_name" - case color - case description - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesUpdateLabel.Input.Body.JsonPayload) - } - public var body: Operations.IssuesUpdateLabel.Input.Body? + public var headers: Operations.IssuesListEventsForTimeline.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesUpdateLabel.Input.Path, - headers: Operations.IssuesUpdateLabel.Input.Headers = .init(), - body: Operations.IssuesUpdateLabel.Input.Body? = nil + path: Operations.IssuesListEventsForTimeline.Input.Path, + query: Operations.IssuesListEventsForTimeline.Input.Query = .init(), + headers: Operations.IssuesListEventsForTimeline.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}/labels/{name}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/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.IssuesListEventsForTimeline.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.Label) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/responses/200/content/application\/json`. + case json([Components.Schemas.TimelineIssueEvents]) /// The associated 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.TimelineIssueEvents] { get throws { switch self { case let .json(body): @@ -21141,26 +21310,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesUpdateLabel.Output.Ok.Body + public var body: Operations.IssuesListEventsForTimeline.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesUpdateLabel.Output.Ok.Body) { + public init( + headers: Operations.IssuesListEventsForTimeline.Output.Ok.Headers = .init(), + body: Operations.IssuesListEventsForTimeline.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesUpdateLabel.Output.Ok) + case ok(Operations.IssuesListEventsForTimeline.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.IssuesUpdateLabel.Output.Ok { + public var ok: Operations.IssuesListEventsForTimeline.Output.Ok { get throws { switch self { case let .ok(response): @@ -21173,6 +21347,52 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/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}/timeline/get(issues/list-events-for-timeline)/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. @@ -21204,112 +21424,24 @@ public enum Operations { } } } - /// 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 enum IssuesDeleteLabel { - public static let id: Swift.String = "issues/delete-label" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/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}/labels/{name}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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. - /// - name: - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - name: Swift.String - ) { - self.owner = owner - self.repo = repo - self.name = name - } - } - public var path: Operations.IssuesDeleteLabel.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.IssuesDeleteLabel.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}/labels/{name}/delete(issues/delete-label)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesDeleteLabel.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/delete(issues/delete-label)/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.IssuesDeleteLabel.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 milestones + /// List labels for a repository /// - /// Lists milestones for a repository. + /// Lists all labels for a repository. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)`. - public enum IssuesListMilestones { - public static let id: Swift.String = "issues/list-milestones" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)`. + public enum IssuesListLabelsForRepo { + public static let id: Swift.String = "issues/list-labels-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -21324,80 +21456,43 @@ public enum Operations { self.repo = repo } } - public var path: Operations.IssuesListMilestones.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query`. + public var path: Operations.IssuesListLabelsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// The state of the milestone. Either `open`, `closed`, or `all`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/state`. - public var state: Operations.IssuesListMilestones.Input.Query.StatePayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/sort`. - @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case dueOn = "due_on" - case completeness = "completeness" - } - /// What to sort results by. Either `due_on` or `completeness`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/sort`. - public var sort: Operations.IssuesListMilestones.Input.Query.SortPayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/direction`. - @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction of the sort. Either `asc` or `desc`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/direction`. - public var direction: Operations.IssuesListMilestones.Input.Query.DirectionPayload? /// The number of results per page (max 100). For more information, see "[Using 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/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - state: The state of the milestone. Either `open`, `closed`, or `all`. - /// - sort: What to sort results by. Either `due_on` or `completeness`. - /// - direction: The direction of the sort. Either `asc` or `desc`. /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - state: Operations.IssuesListMilestones.Input.Query.StatePayload? = nil, - sort: Operations.IssuesListMilestones.Input.Query.SortPayload? = nil, - direction: Operations.IssuesListMilestones.Input.Query.DirectionPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { - self.state = state - self.sort = sort - self.direction = direction self.perPage = perPage self.page = page } } - public var query: Operations.IssuesListMilestones.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/header`. + public var query: Operations.IssuesListLabelsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesListMilestones.Input.Headers + public var headers: Operations.IssuesListLabelsForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -21405,9 +21500,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListMilestones.Input.Path, - query: Operations.IssuesListMilestones.Input.Query = .init(), - headers: Operations.IssuesListMilestones.Input.Headers = .init() + path: Operations.IssuesListLabelsForRepo.Input.Path, + query: Operations.IssuesListLabelsForRepo.Input.Query = .init(), + headers: Operations.IssuesListLabelsForRepo.Input.Headers = .init() ) { self.path = path self.query = query @@ -21416,9 +21511,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -21429,16 +21524,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListMilestones.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/content`. + public var headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Milestone]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.Milestone] { + public var json: [Components.Schemas.Label] { get throws { switch self { case let .json(body): @@ -21448,15 +21543,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListMilestones.Output.Ok.Body + public var body: Operations.IssuesListLabelsForRepo.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListMilestones.Output.Ok.Headers = .init(), - body: Operations.IssuesListMilestones.Output.Ok.Body + headers: Operations.IssuesListLabelsForRepo.Output.Ok.Headers = .init(), + body: Operations.IssuesListLabelsForRepo.Output.Ok.Body ) { self.headers = headers self.body = body @@ -21464,15 +21559,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListMilestones.Output.Ok) + case ok(Operations.IssuesListLabelsForRepo.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.IssuesListMilestones.Output.Ok { + public var ok: Operations.IssuesListLabelsForRepo.Output.Ok { get throws { switch self { case let .ok(response): @@ -21487,7 +21582,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/get(issues/list-labels-for-repo)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -21539,24 +21634,24 @@ public enum Operations { } } } - /// Create a milestone + /// Create a label /// - /// Creates a milestone. + /// 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}/milestones`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)`. - public enum IssuesCreateMilestone { - public static let id: Swift.String = "issues/create-milestone" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)`. + public enum IssuesCreateLabel { + public static let id: Swift.String = "issues/create-label" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/milestones/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/milestones/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -21571,75 +21666,60 @@ public enum Operations { self.repo = repo } } - public var path: Operations.IssuesCreateMilestone.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/header`. + public var path: Operations.IssuesCreateLabel.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesCreateMilestone.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody`. + public var headers: Operations.IssuesCreateLabel.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The title of the milestone. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/title`. - public var title: Swift.String - /// The state of the milestone. Either `open` or `closed`. + /// The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - } - /// The state of the milestone. Either `open` or `closed`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/name`. + public var name: Swift.String + /// The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/state`. - public var state: Operations.IssuesCreateMilestone.Input.Body.JsonPayload.StatePayload? - /// A description of the milestone. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/color`. + public var color: Swift.String? + /// A short description of the label. Must be 100 characters or fewer. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/description`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/json/description`. public var description: Swift.String? - /// The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/due_on`. - public var dueOn: Foundation.Date? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - title: The title of the milestone. - /// - state: The state of the milestone. Either `open` or `closed`. - /// - description: A description of the milestone. - /// - dueOn: The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - name: The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + /// - color: The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + /// - description: A short description of the label. Must be 100 characters or fewer. public init( - title: Swift.String, - state: Operations.IssuesCreateMilestone.Input.Body.JsonPayload.StatePayload? = nil, - description: Swift.String? = nil, - dueOn: Foundation.Date? = nil + name: Swift.String, + color: Swift.String? = nil, + description: Swift.String? = nil ) { - self.title = title - self.state = state + self.name = name + self.color = color self.description = description - self.dueOn = dueOn } public enum CodingKeys: String, CodingKey { - case title - case state + case name + case color case description - case dueOn = "due_on" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/content/application\/json`. - case json(Operations.IssuesCreateMilestone.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/requestBody/content/application\/json`. + case json(Operations.IssuesCreateLabel.Input.Body.JsonPayload) } - public var body: Operations.IssuesCreateMilestone.Input.Body + public var body: Operations.IssuesCreateLabel.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -21647,9 +21727,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesCreateMilestone.Input.Path, - headers: Operations.IssuesCreateMilestone.Input.Headers = .init(), - body: Operations.IssuesCreateMilestone.Input.Body + path: Operations.IssuesCreateLabel.Input.Path, + headers: Operations.IssuesCreateLabel.Input.Headers = .init(), + body: Operations.IssuesCreateLabel.Input.Body ) { self.path = path self.headers = headers @@ -21658,9 +21738,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/headers/Location`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/headers/Location`. public var location: Swift.String? /// Creates a new `Headers`. /// @@ -21671,16 +21751,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesCreateMilestone.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/content`. + public var headers: Operations.IssuesCreateLabel.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Milestone) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/POST/responses/201/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.Milestone { + public var json: Components.Schemas.Label { get throws { switch self { case let .json(body): @@ -21690,15 +21770,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesCreateMilestone.Output.Created.Body + public var body: Operations.IssuesCreateLabel.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesCreateMilestone.Output.Created.Headers = .init(), - body: Operations.IssuesCreateMilestone.Output.Created.Body + headers: Operations.IssuesCreateLabel.Output.Created.Headers = .init(), + body: Operations.IssuesCreateLabel.Output.Created.Body ) { self.headers = headers self.body = body @@ -21706,15 +21786,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.IssuesCreateMilestone.Output.Created) + case created(Operations.IssuesCreateLabel.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.IssuesCreateMilestone.Output.Created { + public var created: Operations.IssuesCreateLabel.Output.Created { get throws { switch self { case let .created(response): @@ -21727,47 +21807,47 @@ public enum Operations { } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/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 ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/post(issues/create-label)/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 ) } @@ -21804,66 +21884,64 @@ public enum Operations { } } } - /// Get a milestone + /// Get a label /// - /// Gets a milestone using the given milestone number. + /// Gets a label using the given name. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)`. - public enum IssuesGetMilestone { - public static let id: Swift.String = "issues/get-milestone" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)`. + public enum IssuesGetLabel { + public static let id: Swift.String = "issues/get-label" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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}/GET/path/milestone_number`. - public var milestoneNumber: Components.Parameters.MilestoneNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/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. - /// - milestoneNumber: The number that identifies the milestone. + /// - name: public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - milestoneNumber: Components.Parameters.MilestoneNumber + name: Swift.String ) { self.owner = owner self.repo = repo - self.milestoneNumber = milestoneNumber + self.name = name } } - public var path: Operations.IssuesGetMilestone.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/header`. + public var path: Operations.IssuesGetLabel.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesGetMilestone.Input.Headers + public var headers: Operations.IssuesGetLabel.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesGetMilestone.Input.Path, - headers: Operations.IssuesGetMilestone.Input.Headers = .init() + path: Operations.IssuesGetLabel.Input.Path, + headers: Operations.IssuesGetLabel.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -21871,15 +21949,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Milestone) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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.Milestone { + public var json: Components.Schemas.Label { get throws { switch self { case let .json(body): @@ -21889,26 +21967,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGetMilestone.Output.Ok.Body + public var body: Operations.IssuesGetLabel.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesGetMilestone.Output.Ok.Body) { + public init(body: Operations.IssuesGetLabel.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetMilestone.Output.Ok) + case ok(Operations.IssuesGetLabel.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.IssuesGetMilestone.Output.Ok { + public var ok: Operations.IssuesGetLabel.Output.Ok { get throws { switch self { case let .ok(response): @@ -21923,7 +22001,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/get(issues/get-label)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -21975,114 +22053,97 @@ public enum Operations { } } } - /// Update a milestone - /// + /// Update a label /// + /// Updates a label using the given label name. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)`. - public enum IssuesUpdateMilestone { - public static let id: Swift.String = "issues/update-milestone" + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)`. + public enum IssuesUpdateLabel { + public static let id: Swift.String = "issues/update-label" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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}/milestones/{milestone_number}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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}/milestones/{milestone_number}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the milestone. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/path/milestone_number`. - public var milestoneNumber: Components.Parameters.MilestoneNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/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. - /// - milestoneNumber: The number that identifies the milestone. + /// - name: public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - milestoneNumber: Components.Parameters.MilestoneNumber + name: Swift.String ) { self.owner = owner self.repo = repo - self.milestoneNumber = milestoneNumber + self.name = name } } - public var path: Operations.IssuesUpdateMilestone.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/header`. + public var path: Operations.IssuesUpdateLabel.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/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.IssuesUpdateMilestone.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody`. + public var headers: Operations.IssuesUpdateLabel.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The title of the milestone. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/title`. - public var title: Swift.String? - /// The state of the milestone. Either `open` or `closed`. + /// The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - } - /// The state of the milestone. Either `open` or `closed`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/new_name`. + public var newName: Swift.String? + /// The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/state`. - public var state: Operations.IssuesUpdateMilestone.Input.Body.JsonPayload.StatePayload? - /// A description of the milestone. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/color`. + public var color: Swift.String? + /// A short description of the label. Must be 100 characters or fewer. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/description`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/json/description`. public var description: Swift.String? - /// The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/due_on`. - public var dueOn: Foundation.Date? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - title: The title of the milestone. - /// - state: The state of the milestone. Either `open` or `closed`. - /// - description: A description of the milestone. - /// - dueOn: The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - newName: The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + /// - color: The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + /// - description: A short description of the label. Must be 100 characters or fewer. public init( - title: Swift.String? = nil, - state: Operations.IssuesUpdateMilestone.Input.Body.JsonPayload.StatePayload? = nil, - description: Swift.String? = nil, - dueOn: Foundation.Date? = nil + newName: Swift.String? = nil, + color: Swift.String? = nil, + description: Swift.String? = nil ) { - self.title = title - self.state = state + self.newName = newName + self.color = color self.description = description - self.dueOn = dueOn } public enum CodingKeys: String, CodingKey { - case title - case state + case newName = "new_name" + case color case description - case dueOn = "due_on" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesUpdateMilestone.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesUpdateLabel.Input.Body.JsonPayload) } - public var body: Operations.IssuesUpdateMilestone.Input.Body? + public var body: Operations.IssuesUpdateLabel.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -22090,9 +22151,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesUpdateMilestone.Input.Path, - headers: Operations.IssuesUpdateMilestone.Input.Headers = .init(), - body: Operations.IssuesUpdateMilestone.Input.Body? = nil + path: Operations.IssuesUpdateLabel.Input.Path, + headers: Operations.IssuesUpdateLabel.Input.Headers = .init(), + body: Operations.IssuesUpdateLabel.Input.Body? = nil ) { self.path = path self.headers = headers @@ -22101,15 +22162,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.Milestone) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/PATCH/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.Milestone { + public var json: Components.Schemas.Label { get throws { switch self { case let .json(body): @@ -22119,26 +22180,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesUpdateMilestone.Output.Ok.Body + public var body: Operations.IssuesUpdateLabel.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesUpdateMilestone.Output.Ok.Body) { + public init(body: Operations.IssuesUpdateLabel.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/patch(issues/update-label)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesUpdateMilestone.Output.Ok) + case ok(Operations.IssuesUpdateLabel.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.IssuesUpdateMilestone.Output.Ok { + public var ok: Operations.IssuesUpdateLabel.Output.Ok { get throws { switch self { case let .ok(response): @@ -22182,102 +22243,282 @@ public enum Operations { } } } - /// Delete a milestone + /// Delete a label /// - /// Deletes a milestone using the given milestone number. + /// Deletes a label using the given label name. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/milestones/{milestone_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)`. - public enum IssuesDeleteMilestone { - public static let id: Swift.String = "issues/delete-milestone" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/delete(issues/delete-label)`. + public enum IssuesDeleteLabel { + public static let id: Swift.String = "issues/delete-label" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/milestones/{milestone_number}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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}/milestones/{milestone_number}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the milestone. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/labels/{name}/DELETE/path/name`. + public var name: Swift.String + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/DELETE/path/milestone_number`. - public var milestoneNumber: Components.Parameters.MilestoneNumber + /// - 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. + /// - name: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + name: Swift.String + ) { + self.owner = owner + self.repo = repo + self.name = name + } + } + public var path: Operations.IssuesDeleteLabel.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.IssuesDeleteLabel.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}/labels/{name}/delete(issues/delete-label)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesDeleteLabel.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/labels/{name}/delete(issues/delete-label)/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.IssuesDeleteLabel.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 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 enum IssuesListMilestones { + public static let id: Swift.String = "issues/list-milestones" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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/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/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. - /// - milestoneNumber: The number that identifies the milestone. public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - milestoneNumber: Components.Parameters.MilestoneNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.IssuesListMilestones.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// The state of the milestone. Either `open`, `closed`, or `all`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/state`. + public var state: Operations.IssuesListMilestones.Input.Query.StatePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case dueOn = "due_on" + case completeness = "completeness" + } + /// What to sort results by. Either `due_on` or `completeness`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/sort`. + public var sort: Operations.IssuesListMilestones.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction of the sort. Either `asc` or `desc`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/query/direction`. + public var direction: Operations.IssuesListMilestones.Input.Query.DirectionPayload? + /// The number of results per page (max 100). For more information, see "[Using 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/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/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: The state of the milestone. Either `open`, `closed`, or `all`. + /// - sort: What to sort results by. Either `due_on` or `completeness`. + /// - direction: The direction of the sort. Either `asc` or `desc`. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Operations.IssuesListMilestones.Input.Query.StatePayload? = nil, + sort: Operations.IssuesListMilestones.Input.Query.SortPayload? = nil, + direction: Operations.IssuesListMilestones.Input.Query.DirectionPayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.owner = owner - self.repo = repo - self.milestoneNumber = milestoneNumber + self.state = state + self.sort = sort + self.direction = direction + self.perPage = perPage + self.page = page } } - public var path: Operations.IssuesDeleteMilestone.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/DELETE/header`. + public var query: Operations.IssuesListMilestones.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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.IssuesDeleteMilestone.Input.Headers + public var headers: Operations.IssuesListMilestones.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesDeleteMilestone.Input.Path, - headers: Operations.IssuesDeleteMilestone.Input.Headers = .init() + path: Operations.IssuesListMilestones.Input.Path, + query: Operations.IssuesListMilestones.Input.Query = .init(), + headers: Operations.IssuesListMilestones.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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.IssuesListMilestones.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Milestone]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Milestone] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListMilestones.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListMilestones.Output.Ok.Headers = .init(), + body: Operations.IssuesListMilestones.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesDeleteMilestone.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)/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.IssuesListMilestones.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.IssuesDeleteMilestone.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListMilestones.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 ) } @@ -22285,7 +22526,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/get(issues/list-milestones)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22337,123 +22578,148 @@ public enum Operations { } } } - /// List labels for issues in a milestone + /// Create a milestone /// - /// Lists labels for issues in a milestone. + /// Creates 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" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/milestones`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)`. + public enum IssuesCreateMilestone { + public static let id: Swift.String = "issues/create-milestone" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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}/milestones/{milestone_number}/labels/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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}/milestones/{milestone_number}/labels/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/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 + repo: Components.Parameters.Repo ) { 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 var path: Operations.IssuesCreateMilestone.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/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.IssuesListLabelsForMilestone.Input.Headers + public var headers: Operations.IssuesCreateMilestone.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/title`. + public var title: Swift.String + /// The state of the milestone. Either `open` or `closed`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. Either `open` or `closed`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/state`. + public var state: Operations.IssuesCreateMilestone.Input.Body.JsonPayload.StatePayload? + /// A description of the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/description`. + public var description: Swift.String? + /// The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/json/due_on`. + public var dueOn: Foundation.Date? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the milestone. + /// - state: The state of the milestone. Either `open` or `closed`. + /// - description: A description of the milestone. + /// - dueOn: The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + title: Swift.String, + state: Operations.IssuesCreateMilestone.Input.Body.JsonPayload.StatePayload? = nil, + description: Swift.String? = nil, + dueOn: Foundation.Date? = nil + ) { + self.title = title + self.state = state + self.description = description + self.dueOn = dueOn + } + public enum CodingKeys: String, CodingKey { + case title + case state + case description + case dueOn = "due_on" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/requestBody/content/application\/json`. + case json(Operations.IssuesCreateMilestone.Input.Body.JsonPayload) + } + public var body: Operations.IssuesCreateMilestone.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.IssuesListLabelsForMilestone.Input.Path, - query: Operations.IssuesListLabelsForMilestone.Input.Query = .init(), - headers: Operations.IssuesListLabelsForMilestone.Input.Headers = .init() + path: Operations.IssuesCreateMilestone.Input.Path, + headers: Operations.IssuesCreateMilestone.Input.Headers = .init(), + body: Operations.IssuesCreateMilestone.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/responses/200/headers`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/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? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/headers/Location`. + public var location: Swift.String? /// Creates a new `Headers`. /// /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link + /// - location: + public init(location: Swift.String? = nil) { + self.location = location } } /// 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`. + public var headers: Operations.IssuesCreateMilestone.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/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]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Milestone) /// The associated 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.Milestone { get throws { switch self { case let .json(body): @@ -22463,15 +22729,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListLabelsForMilestone.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.IssuesCreateMilestone.Output.Created.Body + /// Creates a new `Created`. /// /// - 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 + headers: Operations.IssuesCreateMilestone.Output.Created.Headers = .init(), + body: Operations.IssuesCreateMilestone.Output.Created.Body ) { self.headers = headers self.body = body @@ -22479,22 +22745,68 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)/responses/201`. /// - /// 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: `201 created`. + case created(Operations.IssuesCreateMilestone.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.IssuesListLabelsForMilestone.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.IssuesCreateMilestone.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/post(issues/create-milestone)/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 ) } @@ -22531,208 +22843,82 @@ public enum Operations { } } } - /// 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. + /// Get a milestone /// - /// 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)." + /// Gets a milestone using the given milestone number. /// - /// - 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" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/milestones/{milestone_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)`. + public enum IssuesGetMilestone { + public static let id: Swift.String = "issues/get-milestone" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the repository. + /// The account owner of the repository. The name is not case sensitive. /// - /// - 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/repos/{owner}/{repo}/milestones/{milestone_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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/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}/GET/path/milestone_number`. + public var milestoneNumber: Components.Parameters.MilestoneNumber /// Creates a new `Path`. /// /// - Parameters: - /// - repositoryId: The unique identifier of the repository. - /// - issueNumber: The number that identifies the issue. + /// - 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( - repositoryId: Components.Parameters.RepositoryId, - issueNumber: Components.Parameters.IssueNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + milestoneNumber: Components.Parameters.MilestoneNumber ) { - self.repositoryId = repositoryId - self.issueNumber = issueNumber + self.owner = owner + self.repo = repo + self.milestoneNumber = milestoneNumber } } - public var path: Operations.IssuesAddIssueFieldValues.Input.Path - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/header`. + public var path: Operations.IssuesGetMilestone.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_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.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 + public var headers: Operations.IssuesGetMilestone.Input.Headers /// 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 + path: Operations.IssuesGetMilestone.Input.Path, + headers: Operations.IssuesGetMilestone.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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/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]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Milestone) /// The associated 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] { + public var json: Components.Schemas.Milestone { get throws { switch self { case let .json(body): @@ -22742,26 +22928,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body + public var body: Operations.IssuesGetMilestone.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body) { + public init(body: Operations.IssuesGetMilestone.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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesAddIssueFieldValues.Output.Ok) + case ok(Operations.IssuesGetMilestone.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 { + public var ok: Operations.IssuesGetMilestone.Output.Ok { get throws { switch self { case let .ok(response): @@ -22774,55 +22960,9 @@ public enum Operations { } } } - /// 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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/get(issues/get-milestone)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22843,52 +22983,6 @@ public enum Operations { } } } - /// 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. @@ -22896,14 +22990,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) } @@ -22914,194 +23005,123 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Set 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. + /// Update a milestone /// - /// 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" + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/milestones/{milestone_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)`. + public enum IssuesUpdateMilestone { + public static let id: Swift.String = "issues/update-milestone" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the repository. + /// The account owner of the repository. The name is not case sensitive. /// - /// - 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/repos/{owner}/{repo}/milestones/{milestone_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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/path/milestone_number`. + public var milestoneNumber: Components.Parameters.MilestoneNumber /// Creates a new `Path`. /// /// - Parameters: - /// - repositoryId: The unique identifier of the repository. - /// - issueNumber: The number that identifies the issue. + /// - 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( - repositoryId: Components.Parameters.RepositoryId, - issueNumber: Components.Parameters.IssueNumber + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + milestoneNumber: Components.Parameters.MilestoneNumber ) { - self.repositoryId = repositoryId - self.issueNumber = issueNumber + self.owner = owner + self.repo = repo + self.milestoneNumber = milestoneNumber } } - public var path: Operations.IssuesSetIssueFieldValues.Input.Path - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/header`. + public var path: Operations.IssuesUpdateMilestone.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/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.IssuesSetIssueFieldValues.Input.Headers - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody`. + public var headers: Operations.IssuesUpdateMilestone.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repositories/{repository_id}/issues/{issue_number}/issue-field-values/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/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" - ]) - } + /// The title of the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/title`. + public var title: Swift.String? + /// The state of the milestone. Either `open` or `closed`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" } - /// 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. + /// The state of the milestone. Either `open` or `closed`. /// - /// - 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/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/state`. + public var state: Operations.IssuesUpdateMilestone.Input.Body.JsonPayload.StatePayload? + /// A description of the milestone. /// - /// - 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? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/json/due_on`. + public var dueOn: Foundation.Date? /// 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 + /// - title: The title of the milestone. + /// - state: The state of the milestone. Either `open` or `closed`. + /// - description: A description of the milestone. + /// - dueOn: The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + title: Swift.String? = nil, + state: Operations.IssuesUpdateMilestone.Input.Body.JsonPayload.StatePayload? = nil, + description: Swift.String? = nil, + dueOn: Foundation.Date? = nil + ) { + self.title = title + self.state = state + self.description = description + self.dueOn = dueOn } public enum CodingKeys: String, CodingKey { - case issueFieldValues = "issue_field_values" + case title + case state + case description + case dueOn = "due_on" } } - /// - 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) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesUpdateMilestone.Input.Body.JsonPayload) } - public var body: Operations.IssuesSetIssueFieldValues.Input.Body + public var body: Operations.IssuesUpdateMilestone.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -23109,9 +23129,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesSetIssueFieldValues.Input.Path, - headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), - body: Operations.IssuesSetIssueFieldValues.Input.Body + path: Operations.IssuesUpdateMilestone.Input.Path, + headers: Operations.IssuesUpdateMilestone.Input.Headers = .init(), + body: Operations.IssuesUpdateMilestone.Input.Body? = nil ) { self.path = path self.headers = headers @@ -23120,15 +23140,15 @@ public enum Operations { } @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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/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]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.Milestone) /// The associated 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] { + public var json: Components.Schemas.Milestone { get throws { switch self { case let .json(body): @@ -23138,26 +23158,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body + public var body: Operations.IssuesUpdateMilestone.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body) { + public init(body: Operations.IssuesUpdateMilestone.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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/patch(issues/update-milestone)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesSetIssueFieldValues.Output.Ok) + case ok(Operations.IssuesUpdateMilestone.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 { + public var ok: Operations.IssuesUpdateMilestone.Output.Ok { get throws { switch self { case let .ok(response): @@ -23170,116 +23190,156 @@ public enum Operations { } } } - /// 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`. + /// Undocumented response. /// - /// - 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 - ) - } + /// 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) } } - /// 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 - ) - } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" } } - /// Resource not found + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// 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 enum IssuesDeleteMilestone { + public static let id: Swift.String = "issues/delete-milestone" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/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}/milestones/{milestone_number}/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}/milestones/{milestone_number}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the milestone. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/DELETE/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.IssuesDeleteMilestone.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesDeleteMilestone.Input.Headers + /// Creates a new `Input`. /// - /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/404`. + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesDeleteMilestone.Input.Path, + headers: Operations.IssuesDeleteMilestone.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 /// - /// 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}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/204`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesDeleteMilestone.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/204`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesDeleteMilestone.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 ) } } } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/503`. + /// Resource not found /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/delete(issues/delete-milestone)/responses/404`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// 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 .serviceUnavailable(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "notFound", response: self ) } @@ -23292,14 +23352,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) } @@ -23310,213 +23367,173 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// 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. + /// List labels for issues in a milestone /// - /// 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)." + /// Lists labels for issues in a milestone. /// - /// - 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" + /// - 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/repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/milestones/{milestone_number}/labels/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the repository. + /// The account owner of the repository. 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/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/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/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_field_id`. - public var issueFieldId: Components.Parameters.IssueFieldId + /// - 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: - /// - repositoryId: The unique identifier of the repository. - /// - issueNumber: The number that identifies the issue. - /// - issueFieldId: The unique identifier of the issue field. + /// - 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( - repositoryId: Components.Parameters.RepositoryId, - issueNumber: Components.Parameters.IssueNumber, - issueFieldId: Components.Parameters.IssueFieldId + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + milestoneNumber: Components.Parameters.MilestoneNumber ) { - self.repositoryId = repositoryId - self.issueNumber = issueNumber - self.issueFieldId = issueFieldId + self.owner = owner + self.repo = repo + self.milestoneNumber = milestoneNumber } } - 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 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] + 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.IssuesDeleteIssueFieldValue.Input.Headers + public var headers: Operations.IssuesListLabelsForMilestone.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesDeleteIssueFieldValue.Input.Path, - headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers = .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 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 - ) - } - } - } - /// 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 - ) + 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 } } - } - /// 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 - ) + /// 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 + } + } } } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - 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: `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: 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 } } - /// Service unavailable + /// Response /// - /// - Remark: Generated from `#/paths//repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/milestones/{milestone_number}/labels/get(issues/list-labels-for-milestone)/responses/200`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// 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 `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListLabelsForMilestone.Output.Ok { get throws { switch self { - case let .serviceUnavailable(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "ok", response: self ) } diff --git a/Sources/oidc/Types.swift b/Sources/oidc/Types.swift index b87f553e150..de691556d44 100644 --- a/Sources/oidc/Types.swift +++ b/Sources/oidc/Types.swift @@ -354,15 +354,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/oidc-custom-sub/include_claim_keys`. public var includeClaimKeys: [Swift.String] + /// Whether to opt in to the immutable OIDC subject claim format for the organization. When `true`, new OIDC tokens will use a stable, repository-ID-based `sub` claim instead of the name-based format. + /// + /// - Remark: Generated from `#/components/schemas/oidc-custom-sub/use_immutable_subject`. + public var useImmutableSubject: Swift.Bool? /// Creates a new `OidcCustomSub`. /// /// - Parameters: /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. - public init(includeClaimKeys: [Swift.String]) { + /// - useImmutableSubject: Whether to opt in to the immutable OIDC subject claim format for the organization. When `true`, new OIDC tokens will use a stable, repository-ID-based `sub` claim instead of the name-based format. + public init( + includeClaimKeys: [Swift.String], + useImmutableSubject: Swift.Bool? = nil + ) { self.includeClaimKeys = includeClaimKeys + self.useImmutableSubject = useImmutableSubject } public enum CodingKeys: String, CodingKey { case includeClaimKeys = "include_claim_keys" + case useImmutableSubject = "use_immutable_subject" } } /// An object without any properties. @@ -1908,15 +1918,25 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. public var includeClaimKeys: [Swift.String]? + /// Whether to opt in to the immutable OIDC subject claim format for the organization. When `true`, new OIDC tokens will use a stable, repository-ID-based `sub` claim instead of the name-based format. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/json/use_immutable_subject`. + public var useImmutableSubject: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. - public init(includeClaimKeys: [Swift.String]? = nil) { + /// - useImmutableSubject: Whether to opt in to the immutable OIDC subject claim format for the organization. When `true`, new OIDC tokens will use a stable, repository-ID-based `sub` claim instead of the name-based format. + public init( + includeClaimKeys: [Swift.String]? = nil, + useImmutableSubject: Swift.Bool? = nil + ) { self.includeClaimKeys = includeClaimKeys + self.useImmutableSubject = useImmutableSubject } public enum CodingKeys: String, CodingKey { case includeClaimKeys = "include_claim_keys" + case useImmutableSubject = "use_immutable_subject" } } /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. diff --git a/Sources/private-registries/Client.swift b/Sources/private-registries/Client.swift index 821440dc787..94f31a0d530 100644 --- a/Sources/private-registries/Client.swift +++ b/Sources/private-registries/Client.swift @@ -185,7 +185,7 @@ public struct Client: APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -493,7 +493,7 @@ public struct Client: APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index d7b135d700b..726d537c8d2 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -26,7 +26,7 @@ public protocol APIProtocol: Sendable { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -57,7 +57,7 @@ public protocol APIProtocol: Sendable { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -103,7 +103,7 @@ extension APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -160,7 +160,7 @@ extension APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -472,6 +472,7 @@ public enum Components { case oidcAzure = "oidc_azure" case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" + case oidcCloudsmith = "oidc_cloudsmith" } /// The authentication type for the private registry. /// @@ -541,6 +542,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/identity_mapping_name`. public var identityMappingName: Swift.String? + /// The Cloudsmith organization namespace. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/namespace`. + public var namespace: Swift.String? + /// The Cloudsmith service account slug. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/service_slug`. + public var serviceSlug: Swift.String? + /// The Cloudsmith API host. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/api_host`. + public var apiHost: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/updated_at`. @@ -565,6 +578,9 @@ public enum Components { /// - jfrogOidcProviderName: The JFrog OIDC provider name. /// - audience: The OIDC audience. /// - identityMappingName: The JFrog identity mapping name. + /// - namespace: The Cloudsmith organization namespace. + /// - serviceSlug: The Cloudsmith service account slug. + /// - apiHost: The Cloudsmith API host. /// - createdAt: /// - updatedAt: public init( @@ -585,6 +601,9 @@ public enum Components { jfrogOidcProviderName: Swift.String? = nil, audience: Swift.String? = nil, identityMappingName: Swift.String? = nil, + namespace: Swift.String? = nil, + serviceSlug: Swift.String? = nil, + apiHost: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { @@ -605,6 +624,9 @@ public enum Components { self.jfrogOidcProviderName = jfrogOidcProviderName self.audience = audience self.identityMappingName = identityMappingName + self.namespace = namespace + self.serviceSlug = serviceSlug + self.apiHost = apiHost self.createdAt = createdAt self.updatedAt = updatedAt } @@ -626,6 +648,9 @@ public enum Components { case jfrogOidcProviderName = "jfrog_oidc_provider_name" case audience case identityMappingName = "identity_mapping_name" + case namespace + case serviceSlug = "service_slug" + case apiHost = "api_host" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -671,6 +696,7 @@ public enum Components { case oidcAzure = "oidc_azure" case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" + case oidcCloudsmith = "oidc_cloudsmith" } /// The authentication type for the private registry. /// @@ -744,6 +770,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/identity_mapping_name`. public var identityMappingName: Swift.String? + /// The Cloudsmith organization namespace. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/namespace`. + public var namespace: Swift.String? + /// The Cloudsmith service account slug. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/service_slug`. + public var serviceSlug: Swift.String? + /// The Cloudsmith API host. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/api_host`. + public var apiHost: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/updated_at`. @@ -769,6 +807,9 @@ public enum Components { /// - jfrogOidcProviderName: The JFrog OIDC provider name. /// - audience: The OIDC audience. /// - identityMappingName: The JFrog identity mapping name. + /// - namespace: The Cloudsmith organization namespace. + /// - serviceSlug: The Cloudsmith service account slug. + /// - apiHost: The Cloudsmith API host. /// - createdAt: /// - updatedAt: public init( @@ -790,6 +831,9 @@ public enum Components { jfrogOidcProviderName: Swift.String? = nil, audience: Swift.String? = nil, identityMappingName: Swift.String? = nil, + namespace: Swift.String? = nil, + serviceSlug: Swift.String? = nil, + apiHost: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { @@ -811,6 +855,9 @@ public enum Components { self.jfrogOidcProviderName = jfrogOidcProviderName self.audience = audience self.identityMappingName = identityMappingName + self.namespace = namespace + self.serviceSlug = serviceSlug + self.apiHost = apiHost self.createdAt = createdAt self.updatedAt = updatedAt } @@ -833,6 +880,9 @@ public enum Components { case jfrogOidcProviderName = "jfrog_oidc_provider_name" case audience case identityMappingName = "identity_mapping_name" + case namespace + case serviceSlug = "service_slug" + case apiHost = "api_host" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -1240,7 +1290,7 @@ public enum Operations { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -1340,7 +1390,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? - /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -1349,8 +1399,9 @@ public enum Operations { case oidcAzure = "oidc_azure" case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" + case oidcCloudsmith = "oidc_cloudsmith" } - /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. public var authType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? @@ -1386,7 +1437,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/jfrog_oidc_provider_name`. public var jfrogOidcProviderName: Swift.String? - /// The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/audience`. public var audience: Swift.String? @@ -1394,6 +1445,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/identity_mapping_name`. public var identityMappingName: Swift.String? + /// The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/namespace`. + public var namespace: Swift.String? + /// The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/service_slug`. + public var serviceSlug: Swift.String? + /// The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/api_host`. + public var apiHost: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -1405,7 +1468,7 @@ public enum Operations { /// - keyId: The ID of the key you used to encrypt the secret. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. /// - 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. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. - /// - authType: The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// - authType: The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. /// - tenantId: The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. /// - clientId: The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. /// - awsRegion: The AWS region. Required when `auth_type` is `oidc_aws`. @@ -1414,8 +1477,11 @@ public enum Operations { /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. - /// - audience: The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. + /// - namespace: The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. + /// - serviceSlug: The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. + /// - apiHost: The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. public init( registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, url: Swift.String, @@ -1435,7 +1501,10 @@ public enum Operations { domainOwner: Swift.String? = nil, jfrogOidcProviderName: Swift.String? = nil, audience: Swift.String? = nil, - identityMappingName: Swift.String? = nil + identityMappingName: Swift.String? = nil, + namespace: Swift.String? = nil, + serviceSlug: Swift.String? = nil, + apiHost: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -1456,6 +1525,9 @@ public enum Operations { self.jfrogOidcProviderName = jfrogOidcProviderName self.audience = audience self.identityMappingName = identityMappingName + self.namespace = namespace + self.serviceSlug = serviceSlug + self.apiHost = apiHost } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -1477,6 +1549,9 @@ public enum Operations { case jfrogOidcProviderName = "jfrog_oidc_provider_name" case audience case identityMappingName = "identity_mapping_name" + case namespace + case serviceSlug = "service_slug" + case apiHost = "api_host" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/content/application\/json`. @@ -2003,7 +2078,7 @@ public enum Operations { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -2121,6 +2196,7 @@ public enum Operations { case oidcAzure = "oidc_azure" case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" + case oidcCloudsmith = "oidc_cloudsmith" } /// The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. /// @@ -2158,7 +2234,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/jfrog_oidc_provider_name`. public var jfrogOidcProviderName: Swift.String? - /// The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/audience`. public var audience: Swift.String? @@ -2166,6 +2242,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/identity_mapping_name`. public var identityMappingName: Swift.String? + /// The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/namespace`. + public var namespace: Swift.String? + /// The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/service_slug`. + public var serviceSlug: Swift.String? + /// The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/api_host`. + public var apiHost: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -2186,8 +2274,11 @@ public enum Operations { /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. - /// - audience: The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. + /// - namespace: The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. + /// - serviceSlug: The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. + /// - apiHost: The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. public init( registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, url: Swift.String? = nil, @@ -2207,7 +2298,10 @@ public enum Operations { domainOwner: Swift.String? = nil, jfrogOidcProviderName: Swift.String? = nil, audience: Swift.String? = nil, - identityMappingName: Swift.String? = nil + identityMappingName: Swift.String? = nil, + namespace: Swift.String? = nil, + serviceSlug: Swift.String? = nil, + apiHost: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -2228,6 +2322,9 @@ public enum Operations { self.jfrogOidcProviderName = jfrogOidcProviderName self.audience = audience self.identityMappingName = identityMappingName + self.namespace = namespace + self.serviceSlug = serviceSlug + self.apiHost = apiHost } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -2249,6 +2346,9 @@ public enum Operations { case jfrogOidcProviderName = "jfrog_oidc_provider_name" case audience case identityMappingName = "identity_mapping_name" + case namespace + case serviceSlug = "service_slug" + case apiHost = "api_host" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/content/application\/json`. diff --git a/Sources/pulls/Client.swift b/Sources/pulls/Client.swift index 5b2413c4906..6198e937fa0 100644 --- a/Sources/pulls/Client.swift +++ b/Sources/pulls/Client.swift @@ -1003,6 +1003,234 @@ public struct Client: APIProtocol { } ) } + /// Archive a pull request + /// + /// Archives a pull request. Closes, locks, and marks the pull request as archived. + /// Only repository admins can archive pull requests. + /// Archived pull requests are hidden from non-admin users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)`. + public func pullsArchive(_ input: Operations.PullsArchive.Input) async throws -> Operations.PullsArchive.Output { + try await client.send( + input: input, + forOperation: Operations.PullsArchive.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/pulls/{}/archive", + parameters: [ + input.path.owner, + input.path.repo, + input.path.pullNumber + ] + ) + 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 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 + ) + ) + } + } + ) + } + /// Unarchive a pull request + /// + /// Unarchives a pull request. Removes the archived flag from the pull request. + /// Does not automatically reopen or unlock the pull request. + /// Only repository admins can unarchive pull requests. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)`. + public func pullsUnarchive(_ input: Operations.PullsUnarchive.Input) async throws -> Operations.PullsUnarchive.Output { + try await client.send( + input: input, + forOperation: Operations.PullsUnarchive.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/pulls/{}/archive", + parameters: [ + input.path.owner, + input.path.repo, + input.path.pullNumber + ] + ) + 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 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 review comments on a pull request /// /// Lists all review comments for a specified pull request. By default, review comments diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 0b31e9f3e5d..abca23c4720 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -144,6 +144,24 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/pulls/{pull_number}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/patch(pulls/update)`. func pullsUpdate(_ input: Operations.PullsUpdate.Input) async throws -> Operations.PullsUpdate.Output + /// Archive a pull request + /// + /// Archives a pull request. Closes, locks, and marks the pull request as archived. + /// Only repository admins can archive pull requests. + /// Archived pull requests are hidden from non-admin users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)`. + func pullsArchive(_ input: Operations.PullsArchive.Input) async throws -> Operations.PullsArchive.Output + /// Unarchive a pull request + /// + /// Unarchives a pull request. Removes the archived flag from the pull request. + /// Does not automatically reopen or unlock the pull request. + /// Only repository admins can unarchive pull requests. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)`. + func pullsUnarchive(_ input: Operations.PullsUnarchive.Input) async throws -> Operations.PullsUnarchive.Output /// List review comments on a pull request /// /// Lists all review comments for a specified pull request. By default, review comments @@ -610,6 +628,40 @@ extension APIProtocol { body: body )) } + /// Archive a pull request + /// + /// Archives a pull request. Closes, locks, and marks the pull request as archived. + /// Only repository admins can archive pull requests. + /// Archived pull requests are hidden from non-admin users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)`. + public func pullsArchive( + path: Operations.PullsArchive.Input.Path, + headers: Operations.PullsArchive.Input.Headers = .init() + ) async throws -> Operations.PullsArchive.Output { + try await pullsArchive(Operations.PullsArchive.Input( + path: path, + headers: headers + )) + } + /// Unarchive a pull request + /// + /// Unarchives a pull request. Removes the archived flag from the pull request. + /// Does not automatically reopen or unlock the pull request. + /// Only repository admins can unarchive pull requests. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)`. + public func pullsUnarchive( + path: Operations.PullsUnarchive.Input.Path, + headers: Operations.PullsUnarchive.Input.Headers = .init() + ) async throws -> Operations.PullsUnarchive.Output { + try await pullsUnarchive(Operations.PullsUnarchive.Input( + path: path, + headers: headers + )) + } /// List review comments on a pull request /// /// Lists all review comments for a specified pull request. By default, review comments @@ -7487,6 +7539,412 @@ public enum Operations { } } } + /// Archive a pull request + /// + /// Archives a pull request. Closes, locks, and marks the pull request as archived. + /// Only repository admins can archive pull requests. + /// Archived pull requests are hidden from non-admin users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)`. + public enum PullsArchive { + public static let id: Swift.String = "pulls/archive" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/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}/pulls/{pull_number}/archive/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}/pulls/{pull_number}/archive/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the pull request. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/PUT/path/pull_number`. + public var pullNumber: Components.Parameters.PullNumber + /// 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. + /// - pullNumber: The number that identifies the pull request. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + pullNumber: Components.Parameters.PullNumber + ) { + self.owner = owner + self.repo = repo + self.pullNumber = pullNumber + } + } + public var path: Operations.PullsArchive.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/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.PullsArchive.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.PullsArchive.Input.Path, + headers: Operations.PullsArchive.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}/pulls/{pull_number}/archive/put(pulls/archive)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.PullsArchive.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)/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.PullsArchive.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}/pulls/{pull_number}/archive/put(pulls/archive)/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}/pulls/{pull_number}/archive/put(pulls/archive)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/put(pulls/archive)/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 + ] + } + } + } + /// Unarchive a pull request + /// + /// Unarchives a pull request. Removes the archived flag from the pull request. + /// Does not automatically reopen or unlock the pull request. + /// Only repository admins can unarchive pull requests. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/pulls/{pull_number}/archive`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)`. + public enum PullsUnarchive { + public static let id: Swift.String = "pulls/unarchive" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/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/{pull_number}/archive/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/{pull_number}/archive/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the pull request. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/DELETE/path/pull_number`. + public var pullNumber: Components.Parameters.PullNumber + /// 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. + /// - pullNumber: The number that identifies the pull request. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + pullNumber: Components.Parameters.PullNumber + ) { + self.owner = owner + self.repo = repo + self.pullNumber = pullNumber + } + } + public var path: Operations.PullsUnarchive.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/archive/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.PullsUnarchive.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.PullsUnarchive.Input.Path, + headers: Operations.PullsUnarchive.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}/pulls/{pull_number}/archive/delete(pulls/unarchive)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.PullsUnarchive.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)/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.PullsUnarchive.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}/pulls/{pull_number}/archive/delete(pulls/unarchive)/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}/pulls/{pull_number}/archive/delete(pulls/unarchive)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/archive/delete(pulls/unarchive)/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 review comments on a pull request /// /// Lists all review comments for a specified pull request. By default, review comments diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index b4e870dabae..b1409d266bd 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -5085,13 +5085,13 @@ public enum Operations { /// Creates a new `UnprocessableContent`. public init() {} } - /// State does not match the resolution or resolution comment, or assignee does not have write access to the repository + /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert /// /// - 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, or assignee does not have write access to the repository + /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. /// diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 2b6e93c2823..d786d3f083a 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 2b6e93c2823a6f5dc1f6a3727b6b53eafa407fb2 +Subproject commit d786d3f083a842b342a5395a58ca01cd0faa71e6