diff --git a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift index 0257fd3bd9..c9368daee8 100644 --- a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift +++ b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift @@ -6,6 +6,6 @@ import PackageDescription let package = Package( name: "manifest-swift-openapi-generator", dependencies: [ - .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.9.0"), + .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.10.1"), ] ) diff --git a/.gitmodules b/.gitmodules index cfdc733eb7..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "Submodule/github/rest-api-description"] - path = Submodule/github/rest-api-description - url = https://github.com/github/rest-api-description.git - shallow = true diff --git a/.spi.yml b/.spi.yml index 44c3facca8..b079a13049 100644 --- a/.spi.yml +++ b/.spi.yml @@ -36,6 +36,7 @@ builder: - GitHubRestAPIPackages - GitHubRestAPIPrivate_Registries - GitHubRestAPIProjects + - GitHubRestAPIProjects_Classic - GitHubRestAPIPulls - GitHubRestAPIRate_Limit - GitHubRestAPIReactions diff --git a/Mintfile b/Mintfile index 2cf622ccfc..edd67edc95 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ yonaskolb/Mint@0.18.0 -apple/swift-openapi-generator@1.9.0 +apple/swift-openapi-generator@1.10.1 diff --git a/Package.swift b/Package.swift index 36b9524d02..5366bc18ee 100644 --- a/Package.swift +++ b/Package.swift @@ -45,6 +45,7 @@ let package = Package( .library(name: "GitHubRestAPIPackages", targets: ["GitHubRestAPIPackages"]), .library(name: "GitHubRestAPIPrivate_Registries", targets: ["GitHubRestAPIPrivate_Registries"]), .library(name: "GitHubRestAPIProjects", targets: ["GitHubRestAPIProjects"]), + .library(name: "GitHubRestAPIProjects_Classic", targets: ["GitHubRestAPIProjects_Classic"]), .library(name: "GitHubRestAPIPulls", targets: ["GitHubRestAPIPulls"]), .library(name: "GitHubRestAPIRate_Limit", targets: ["GitHubRestAPIRate_Limit"]), .library(name: "GitHubRestAPIReactions", targets: ["GitHubRestAPIReactions"]), @@ -332,6 +333,14 @@ let package = Package( ], path: "Sources/projects" ), + .target( + name: "GitHubRestAPIProjects_Classic", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/projects-classic" + ), .target( name: "GitHubRestAPIPulls", dependencies: [ diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 35c46944c0..04dad52f07 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -5953,6 +5953,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -5973,6 +5978,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -6118,7 +6128,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 11b3d4f3b2..cae57fef46 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -2909,6 +2909,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -3714,6 +3715,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -3734,6 +3740,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -3879,7 +3890,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/apps/Client.swift b/Sources/apps/Client.swift index 5b84b15447..16f3ae909a 100644 --- a/Sources/apps/Client.swift +++ b/Sources/apps/Client.swift @@ -1006,7 +1006,7 @@ public struct Client: APIProtocol { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -1243,7 +1243,7 @@ public struct Client: APIProtocol { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index c0d1cd609b..95508faeaa 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -99,7 +99,7 @@ public protocol APIProtocol: Sendable { func appsGetInstallation(_ input: Operations.AppsGetInstallation.Input) async throws -> Operations.AppsGetInstallation.Output /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -121,7 +121,7 @@ public protocol APIProtocol: Sendable { func appsCreateInstallationAccessToken(_ input: Operations.AppsCreateInstallationAccessToken.Input) async throws -> Operations.AppsCreateInstallationAccessToken.Output /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -496,7 +496,7 @@ extension APIProtocol { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -536,7 +536,7 @@ extension APIProtocol { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -3180,6 +3180,8 @@ public enum Components { public var htmlUrl: Swift.String /// - Remark: Generated from `#/components/schemas/installation/app_id`. public var appId: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/client_id`. + public var clientId: Swift.String? /// The ID of the user or organization this token is being scoped to. /// /// - Remark: Generated from `#/components/schemas/installation/target_id`. @@ -3218,6 +3220,7 @@ public enum Components { /// - repositoriesUrl: /// - htmlUrl: /// - appId: + /// - clientId: /// - targetId: The ID of the user or organization this token is being scoped to. /// - targetType: /// - permissions: @@ -3239,6 +3242,7 @@ public enum Components { repositoriesUrl: Swift.String, htmlUrl: Swift.String, appId: Swift.Int, + clientId: Swift.String? = nil, targetId: Swift.Int, targetType: Swift.String, permissions: Components.Schemas.AppPermissions, @@ -3260,6 +3264,7 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.htmlUrl = htmlUrl self.appId = appId + self.clientId = clientId self.targetId = targetId self.targetType = targetType self.permissions = permissions @@ -3282,6 +3287,7 @@ public enum Components { case repositoriesUrl = "repositories_url" case htmlUrl = "html_url" case appId = "app_id" + case clientId = "client_id" case targetId = "target_id" case targetType = "target_type" case permissions @@ -6825,7 +6831,7 @@ public enum Operations { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -7238,7 +7244,7 @@ public enum Operations { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index f017adac44..8d870a6c47 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -974,6 +974,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -994,6 +999,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -1139,7 +1149,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 039a6617ab..9ff3b2c90f 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -3100,6 +3100,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.CodeScanningInvalidState.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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 diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 866b30a79e..e6c4fcf698 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -3979,6 +3979,34 @@ public enum Components { self.body = body } } + public struct CodeScanningInvalidState: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/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.CodeScanningInvalidState.Body + /// Creates a new `CodeScanningInvalidState`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.CodeScanningInvalidState.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { @@ -9066,6 +9094,29 @@ public enum Operations { } } } + /// Response if the configuration change cannot be made because the repository is not in the required state + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.CodeScanningInvalidState) + /// 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.CodeScanningInvalidState { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Service unavailable /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/503`. diff --git a/Sources/code-security/Client.swift b/Sources/code-security/Client.swift index a6b1e09031..7bfccdf2bc 100644 --- a/Sources/code-security/Client.swift +++ b/Sources/code-security/Client.swift @@ -1217,7 +1217,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -1434,7 +1434,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -2250,7 +2250,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index baaac91aca..74a949268d 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -122,7 +122,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -144,7 +144,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -228,7 +228,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. @@ -443,7 +443,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -485,7 +485,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -633,7 +633,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. @@ -1038,7 +1038,26 @@ public enum Components { /// Feature options for code scanning /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. - public var codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? + public struct CodeScanningOptionsPayload: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptionsPayload`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } + /// Feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. @@ -1326,7 +1345,7 @@ public enum Components { dependencyGraphAutosubmitActionOptions: Components.Schemas.CodeSecurityConfiguration.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Components.Schemas.CodeSecurityConfiguration.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? = nil, - codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? = nil, + codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? = nil, codeScanningDefaultSetup: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupOptionsPayload? = nil, codeScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -1405,6 +1424,25 @@ public enum Components { case updatedAt = "updated_at" } } + /// Security Configuration feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options`. + public struct CodeScanningOptions: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptions`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } /// Feature options for code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options`. @@ -2415,6 +2453,10 @@ public enum Operations { public var description: Swift.String /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -2424,8 +2466,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph`. @@ -2497,6 +2555,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -2523,6 +2583,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning`. @@ -2624,14 +2696,17 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the enterprise. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningValidityChecks: The enablement status of secret scanning validity checks @@ -2644,14 +2719,17 @@ public enum Operations { name: Swift.String, description: Swift.String, advancedSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningValidityChecks: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningValidityChecksPayload? = nil, @@ -2664,14 +2742,17 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningValidityChecks = secretScanningValidityChecks @@ -2685,14 +2766,17 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningValidityChecks = "secret_scanning_validity_checks" @@ -2716,6 +2800,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -2736,6 +2824,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -2748,6 +2840,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -2784,14 +2880,17 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_validity_checks", @@ -3402,6 +3501,10 @@ public enum Operations { public var description: Swift.String? /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -3411,8 +3514,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. @@ -3510,6 +3629,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. @@ -3611,6 +3742,7 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique across the enterprise. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission @@ -3619,6 +3751,7 @@ public enum Operations { /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningValidityChecks: The enablement status of secret scanning validity checks @@ -3631,6 +3764,7 @@ public enum Operations { name: Swift.String? = nil, description: Swift.String? = nil, advancedSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, @@ -3639,6 +3773,7 @@ public enum Operations { codeScanningDefaultSetup: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningValidityChecks: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningValidityChecksPayload? = nil, @@ -3651,6 +3786,7 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions @@ -3659,6 +3795,7 @@ public enum Operations { self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningValidityChecks = secretScanningValidityChecks @@ -3672,6 +3809,7 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" @@ -3680,6 +3818,7 @@ public enum Operations { case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningValidityChecks = "secret_scanning_validity_checks" @@ -3703,6 +3842,10 @@ public enum Operations { Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -3735,6 +3878,10 @@ public enum Operations { Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -3771,6 +3918,7 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", @@ -3779,6 +3927,7 @@ public enum Operations { "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_validity_checks", @@ -4951,7 +5100,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -5227,6 +5376,10 @@ public enum Operations { public var description: Swift.String /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -5236,8 +5389,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph`. @@ -5309,6 +5478,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -5335,6 +5506,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning`. @@ -5509,14 +5692,17 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningDelegatedBypass: The enablement status of secret scanning delegated bypass @@ -5531,14 +5717,17 @@ public enum Operations { name: Swift.String, description: Swift.String, advancedSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningDelegatedBypass: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedBypassPayload? = nil, @@ -5553,14 +5742,17 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningDelegatedBypass = secretScanningDelegatedBypass @@ -5576,14 +5768,17 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" @@ -5609,6 +5804,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -5629,6 +5828,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -5641,6 +5844,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -5685,14 +5892,17 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", @@ -5815,7 +6025,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -6067,14 +6277,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// An array of repository IDs to detach from configurations. + /// An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. + /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided. public init(selectedRepositoryIds: [Swift.Int]? = nil) { self.selectedRepositoryIds = selectedRepositoryIds } @@ -6558,6 +6768,10 @@ public enum Operations { public var description: Swift.String? /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -6567,8 +6781,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. @@ -6666,6 +6896,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. @@ -6840,6 +7082,7 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission @@ -6848,6 +7091,7 @@ public enum Operations { /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningDelegatedBypass: The enablement status of secret scanning delegated bypass @@ -6862,6 +7106,7 @@ public enum Operations { name: Swift.String? = nil, description: Swift.String? = nil, advancedSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, @@ -6870,6 +7115,7 @@ public enum Operations { codeScanningDefaultSetup: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningDelegatedBypass: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedBypassPayload? = nil, @@ -6884,6 +7130,7 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions @@ -6892,6 +7139,7 @@ public enum Operations { self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningDelegatedBypass = secretScanningDelegatedBypass @@ -6907,6 +7155,7 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" @@ -6915,6 +7164,7 @@ public enum Operations { case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" @@ -6940,6 +7190,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -6972,6 +7226,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -7016,6 +7274,7 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", @@ -7024,6 +7283,7 @@ public enum Operations { "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", @@ -7848,7 +8108,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 6fbdc1fad3..65a711b53d 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -2776,6 +2776,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2796,6 +2801,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2941,7 +2951,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index f674320365..e1ca39536a 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -2474,6 +2474,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2494,6 +2499,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2639,7 +2649,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 652329b744..55c32bf47b 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -3854,11 +3854,11 @@ public struct Client: APIProtocol { /// /// 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)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 44070e1086..1a4b16a734 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -337,11 +337,11 @@ public protocol APIProtocol: Sendable { /// /// 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)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -1057,11 +1057,11 @@ extension APIProtocol { /// /// 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)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -3653,6 +3653,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -4482,6 +4483,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -12287,6 +12289,7 @@ public enum Operations { @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { case completed = "completed" case notPlanned = "not_planned" + case duplicate = "duplicate" case reopened = "reopened" } /// The reason for the state change. Ignored unless `state` is changed. @@ -16164,11 +16167,11 @@ public enum Operations { /// /// 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)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 7f00fc0ad5..c68150a0a1 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -2095,6 +2095,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2115,6 +2120,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2260,7 +2270,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index e3ebadc300..dee0f32146 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -4377,6 +4377,9 @@ public struct Client: APIProtocol { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. public func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output { @@ -4683,6 +4686,9 @@ public struct Client: APIProtocol { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. public func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output { diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 0fcc943f1a..b708dfd4a1 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -454,6 +454,9 @@ public protocol APIProtocol: Sendable { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output @@ -485,6 +488,9 @@ public protocol APIProtocol: Sendable { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output @@ -1753,6 +1759,9 @@ extension APIProtocol { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. public func orgsRemoveMember( @@ -1810,6 +1819,9 @@ extension APIProtocol { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. public func orgsRemoveMembershipForUser( @@ -4442,6 +4454,8 @@ public enum Components { public var htmlUrl: Swift.String /// - Remark: Generated from `#/components/schemas/installation/app_id`. public var appId: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/client_id`. + public var clientId: Swift.String? /// The ID of the user or organization this token is being scoped to. /// /// - Remark: Generated from `#/components/schemas/installation/target_id`. @@ -4480,6 +4494,7 @@ public enum Components { /// - repositoriesUrl: /// - htmlUrl: /// - appId: + /// - clientId: /// - targetId: The ID of the user or organization this token is being scoped to. /// - targetType: /// - permissions: @@ -4501,6 +4516,7 @@ public enum Components { repositoriesUrl: Swift.String, htmlUrl: Swift.String, appId: Swift.Int, + clientId: Swift.String? = nil, targetId: Swift.Int, targetType: Swift.String, permissions: Components.Schemas.AppPermissions, @@ -4522,6 +4538,7 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.htmlUrl = htmlUrl self.appId = appId + self.clientId = clientId self.targetId = targetId self.targetType = targetType self.permissions = permissions @@ -4544,6 +4561,7 @@ public enum Components { case repositoriesUrl = "repositories_url" case htmlUrl = "html_url" case appId = "app_id" + case clientId = "client_id" case targetId = "target_id" case targetType = "target_type" case permissions @@ -4694,6 +4712,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -4714,6 +4737,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -4859,7 +4887,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -6967,6 +6995,15 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-membership/role`. public var role: Components.Schemas.OrgMembership.RolePayload + /// Whether the user has direct membership in the organization. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/direct_membership`. + public var directMembership: Swift.Bool? + /// The slugs of the enterprise teams providing the user with indirect membership in the organization. + /// A limit of 100 enterprise team slugs is returned. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/enterprise_teams_providing_indirect_membership`. + public var enterpriseTeamsProvidingIndirectMembership: [Swift.String]? /// - Remark: Generated from `#/components/schemas/org-membership/organization_url`. public var organizationUrl: Swift.String /// - Remark: Generated from `#/components/schemas/org-membership/organization`. @@ -6996,6 +7033,8 @@ public enum Components { /// - url: /// - state: The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. /// - role: The user's membership type in the organization. + /// - directMembership: Whether the user has direct membership in the organization. + /// - enterpriseTeamsProvidingIndirectMembership: The slugs of the enterprise teams providing the user with indirect membership in the organization. /// - organizationUrl: /// - organization: /// - user: @@ -7004,6 +7043,8 @@ public enum Components { url: Swift.String, state: Components.Schemas.OrgMembership.StatePayload, role: Components.Schemas.OrgMembership.RolePayload, + directMembership: Swift.Bool? = nil, + enterpriseTeamsProvidingIndirectMembership: [Swift.String]? = nil, organizationUrl: Swift.String, organization: Components.Schemas.OrganizationSimple, user: Components.Schemas.NullableSimpleUser? = nil, @@ -7012,6 +7053,8 @@ public enum Components { self.url = url self.state = state self.role = role + self.directMembership = directMembership + self.enterpriseTeamsProvidingIndirectMembership = enterpriseTeamsProvidingIndirectMembership self.organizationUrl = organizationUrl self.organization = organization self.user = user @@ -7021,6 +7064,8 @@ public enum Components { case url case state case role + case directMembership = "direct_membership" + case enterpriseTeamsProvidingIndirectMembership = "enterprise_teams_providing_indirect_membership" case organizationUrl = "organization_url" case organization case user @@ -18171,6 +18216,9 @@ public enum Operations { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. public enum OrgsRemoveMember { @@ -18740,6 +18788,9 @@ public enum Operations { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. public enum OrgsRemoveMembershipForUser { diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index a6ad90ac01..36747349f4 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -1206,6 +1206,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -1226,6 +1231,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -1371,7 +1381,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 56467dc3c2..48220a69a0 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -442,6 +442,18 @@ public enum Components { case mavenRepository = "maven_repository" case nugetFeed = "nuget_feed" case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -515,6 +527,18 @@ public enum Components { case mavenRepository = "maven_repository" case nugetFeed = "nuget_feed" case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -1030,6 +1054,18 @@ public enum Operations { case mavenRepository = "maven_repository" case nugetFeed = "nuget_feed" case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -1683,6 +1719,18 @@ public enum Operations { case mavenRepository = "maven_repository" case nugetFeed = "nuget_feed" case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// diff --git a/Sources/projects-classic/Client.swift b/Sources/projects-classic/Client.swift new file mode 100644 index 0000000000..6a350dafed --- /dev/null +++ b/Sources/projects-classic/Client.swift @@ -0,0 +1,3715 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +import HTTPTypes +/// GitHub's v3 REST API. +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + public func projectsClassicListForOrg(_ input: Operations.ProjectsClassicListForOrg.Input) async throws -> Operations.ProjectsClassicListForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projects", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForOrg.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.ProjectsClassicListForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + public func projectsClassicCreateForOrg(_ input: Operations.ProjectsClassicCreateForOrg.Input) async throws -> Operations.ProjectsClassicCreateForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projects", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)`. + @available(*, deprecated) + public func projectsClassicGetCard(_ input: Operations.ProjectsClassicGetCard.Input) async throws -> Operations.ProjectsClassicGetCard.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGetCard.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/cards/{}", + parameters: [ + input.path.cardId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGetCard.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectCard.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an existing project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)`. + @available(*, deprecated) + public func projectsClassicUpdateCard(_ input: Operations.ProjectsClassicUpdateCard.Input) async throws -> Operations.ProjectsClassicUpdateCard.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicUpdateCard.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/cards/{}", + parameters: [ + input.path.cardId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectCard.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)`. + @available(*, deprecated) + public func projectsClassicDeleteCard(_ input: Operations.ProjectsClassicDeleteCard.Input) async throws -> Operations.ProjectsClassicDeleteCard.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicDeleteCard.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/cards/{}", + parameters: [ + input.path.cardId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Move a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)`. + @available(*, deprecated) + public func projectsClassicMoveCard(_ input: Operations.ProjectsClassicMoveCard.Input) async throws -> Operations.ProjectsClassicMoveCard.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicMoveCard.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/cards/{}/moves", + parameters: [ + input.path.cardId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicMoveCard.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicMoveCard.Output.Created.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + public func projectsClassicGetColumn(_ input: Operations.ProjectsClassicGetColumn.Input) async throws -> Operations.ProjectsClassicGetColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGetColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGetColumn.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + public func projectsClassicUpdateColumn(_ input: Operations.ProjectsClassicUpdateColumn.Input) async throws -> Operations.ProjectsClassicUpdateColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicUpdateColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + public func projectsClassicDeleteColumn(_ input: Operations.ProjectsClassicDeleteColumn.Input) async throws -> Operations.ProjectsClassicDeleteColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicDeleteColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project cards + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)`. + @available(*, deprecated) + public func projectsClassicListCards(_ input: Operations.ProjectsClassicListCards.Input) async throws -> Operations.ProjectsClassicListCards.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListCards.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}/cards", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "archived_state", + value: input.query.archivedState + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListCards.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.ProjectsClassicListCards.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectCard].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)`. + @available(*, deprecated) + public func projectsClassicCreateCard(_ input: Operations.ProjectsClassicCreateCard.Input) async throws -> Operations.ProjectsClassicCreateCard.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateCard.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}/cards", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateCard.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectCard.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + public func projectsClassicMoveColumn(_ input: Operations.ProjectsClassicMoveColumn.Input) async throws -> Operations.ProjectsClassicMoveColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicMoveColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}/moves", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicMoveColumn.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + public func projectsClassicGet(_ input: Operations.ProjectsClassicGet.Input) async throws -> Operations.ProjectsClassicGet.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGet.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + public func projectsClassicUpdate(_ input: Operations.ProjectsClassicUpdate.Input) async throws -> Operations.ProjectsClassicUpdate.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicUpdate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdate.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + public func projectsClassicDelete(_ input: Operations.ProjectsClassicDelete.Input) async throws -> Operations.ProjectsClassicDelete.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicDelete.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + public func projectsClassicListCollaborators(_ input: Operations.ProjectsClassicListCollaborators.Input) async throws -> Operations.ProjectsClassicListCollaborators.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListCollaborators.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "affiliation", + value: input.query.affiliation + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListCollaborators.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.ProjectsClassicListCollaborators.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + public func projectsClassicAddCollaborator(_ input: Operations.ProjectsClassicAddCollaborator.Input) async throws -> Operations.ProjectsClassicAddCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicAddCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + public func projectsClassicRemoveCollaborator(_ input: Operations.ProjectsClassicRemoveCollaborator.Input) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicRemoveCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + public func projectsClassicGetPermissionForUser(_ input: Operations.ProjectsClassicGetPermissionForUser.Input) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGetPermissionForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}/permission", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectCollaboratorPermission.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + public func projectsClassicListColumns(_ input: Operations.ProjectsClassicListColumns.Input) async throws -> Operations.ProjectsClassicListColumns.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListColumns.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/columns", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListColumns.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.ProjectsClassicListColumns.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectColumn].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + public func projectsClassicCreateColumn(_ input: Operations.ProjectsClassicCreateColumn.Input) async throws -> Operations.ProjectsClassicCreateColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/columns", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateColumn.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + public func projectsClassicListForRepo(_ input: Operations.ProjectsClassicListForRepo.Input) async throws -> Operations.ProjectsClassicListForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/projects", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForRepo.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.ProjectsClassicListForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + public func projectsClassicCreateForRepo(_ input: Operations.ProjectsClassicCreateForRepo.Input) async throws -> Operations.ProjectsClassicCreateForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/projects", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + public func projectsClassicCreateForAuthenticatedUser(_ input: Operations.ProjectsClassicCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForAuthenticatedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/user/projects", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + public func projectsClassicListForUser(_ input: Operations.ProjectsClassicListForUser.Input) async throws -> Operations.ProjectsClassicListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projects", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForUser.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.ProjectsClassicListForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/projects-classic/Types.swift b/Sources/projects-classic/Types.swift new file mode 100644 index 0000000000..1f1851d56e --- /dev/null +++ b/Sources/projects-classic/Types.swift @@ -0,0 +1,8916 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable { + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + func projectsClassicListForOrg(_ input: Operations.ProjectsClassicListForOrg.Input) async throws -> Operations.ProjectsClassicListForOrg.Output + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + func projectsClassicCreateForOrg(_ input: Operations.ProjectsClassicCreateForOrg.Input) async throws -> Operations.ProjectsClassicCreateForOrg.Output + /// Get a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)`. + @available(*, deprecated) + func projectsClassicGetCard(_ input: Operations.ProjectsClassicGetCard.Input) async throws -> Operations.ProjectsClassicGetCard.Output + /// Update an existing project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)`. + @available(*, deprecated) + func projectsClassicUpdateCard(_ input: Operations.ProjectsClassicUpdateCard.Input) async throws -> Operations.ProjectsClassicUpdateCard.Output + /// Delete a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)`. + @available(*, deprecated) + func projectsClassicDeleteCard(_ input: Operations.ProjectsClassicDeleteCard.Input) async throws -> Operations.ProjectsClassicDeleteCard.Output + /// Move a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)`. + @available(*, deprecated) + func projectsClassicMoveCard(_ input: Operations.ProjectsClassicMoveCard.Input) async throws -> Operations.ProjectsClassicMoveCard.Output + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + func projectsClassicGetColumn(_ input: Operations.ProjectsClassicGetColumn.Input) async throws -> Operations.ProjectsClassicGetColumn.Output + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + func projectsClassicUpdateColumn(_ input: Operations.ProjectsClassicUpdateColumn.Input) async throws -> Operations.ProjectsClassicUpdateColumn.Output + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + func projectsClassicDeleteColumn(_ input: Operations.ProjectsClassicDeleteColumn.Input) async throws -> Operations.ProjectsClassicDeleteColumn.Output + /// List project cards + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)`. + @available(*, deprecated) + func projectsClassicListCards(_ input: Operations.ProjectsClassicListCards.Input) async throws -> Operations.ProjectsClassicListCards.Output + /// Create a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)`. + @available(*, deprecated) + func projectsClassicCreateCard(_ input: Operations.ProjectsClassicCreateCard.Input) async throws -> Operations.ProjectsClassicCreateCard.Output + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + func projectsClassicMoveColumn(_ input: Operations.ProjectsClassicMoveColumn.Input) async throws -> Operations.ProjectsClassicMoveColumn.Output + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + func projectsClassicGet(_ input: Operations.ProjectsClassicGet.Input) async throws -> Operations.ProjectsClassicGet.Output + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + func projectsClassicUpdate(_ input: Operations.ProjectsClassicUpdate.Input) async throws -> Operations.ProjectsClassicUpdate.Output + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + func projectsClassicDelete(_ input: Operations.ProjectsClassicDelete.Input) async throws -> Operations.ProjectsClassicDelete.Output + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + func projectsClassicListCollaborators(_ input: Operations.ProjectsClassicListCollaborators.Input) async throws -> Operations.ProjectsClassicListCollaborators.Output + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + func projectsClassicAddCollaborator(_ input: Operations.ProjectsClassicAddCollaborator.Input) async throws -> Operations.ProjectsClassicAddCollaborator.Output + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + func projectsClassicRemoveCollaborator(_ input: Operations.ProjectsClassicRemoveCollaborator.Input) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + func projectsClassicGetPermissionForUser(_ input: Operations.ProjectsClassicGetPermissionForUser.Input) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + func projectsClassicListColumns(_ input: Operations.ProjectsClassicListColumns.Input) async throws -> Operations.ProjectsClassicListColumns.Output + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + func projectsClassicCreateColumn(_ input: Operations.ProjectsClassicCreateColumn.Input) async throws -> Operations.ProjectsClassicCreateColumn.Output + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + func projectsClassicListForRepo(_ input: Operations.ProjectsClassicListForRepo.Input) async throws -> Operations.ProjectsClassicListForRepo.Output + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + func projectsClassicCreateForRepo(_ input: Operations.ProjectsClassicCreateForRepo.Input) async throws -> Operations.ProjectsClassicCreateForRepo.Output + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + func projectsClassicCreateForAuthenticatedUser(_ input: Operations.ProjectsClassicCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + func projectsClassicListForUser(_ input: Operations.ProjectsClassicListForUser.Input) async throws -> Operations.ProjectsClassicListForUser.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + public func projectsClassicListForOrg( + path: Operations.ProjectsClassicListForOrg.Input.Path, + query: Operations.ProjectsClassicListForOrg.Input.Query = .init(), + headers: Operations.ProjectsClassicListForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForOrg.Output { + try await projectsClassicListForOrg(Operations.ProjectsClassicListForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + public func projectsClassicCreateForOrg( + path: Operations.ProjectsClassicCreateForOrg.Input.Path, + headers: Operations.ProjectsClassicCreateForOrg.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForOrg.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForOrg.Output { + try await projectsClassicCreateForOrg(Operations.ProjectsClassicCreateForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)`. + @available(*, deprecated) + public func projectsClassicGetCard( + path: Operations.ProjectsClassicGetCard.Input.Path, + headers: Operations.ProjectsClassicGetCard.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGetCard.Output { + try await projectsClassicGetCard(Operations.ProjectsClassicGetCard.Input( + path: path, + headers: headers + )) + } + /// Update an existing project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)`. + @available(*, deprecated) + public func projectsClassicUpdateCard( + path: Operations.ProjectsClassicUpdateCard.Input.Path, + headers: Operations.ProjectsClassicUpdateCard.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateCard.Input.Body? = nil + ) async throws -> Operations.ProjectsClassicUpdateCard.Output { + try await projectsClassicUpdateCard(Operations.ProjectsClassicUpdateCard.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)`. + @available(*, deprecated) + public func projectsClassicDeleteCard( + path: Operations.ProjectsClassicDeleteCard.Input.Path, + headers: Operations.ProjectsClassicDeleteCard.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicDeleteCard.Output { + try await projectsClassicDeleteCard(Operations.ProjectsClassicDeleteCard.Input( + path: path, + headers: headers + )) + } + /// Move a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)`. + @available(*, deprecated) + public func projectsClassicMoveCard( + path: Operations.ProjectsClassicMoveCard.Input.Path, + headers: Operations.ProjectsClassicMoveCard.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveCard.Input.Body + ) async throws -> Operations.ProjectsClassicMoveCard.Output { + try await projectsClassicMoveCard(Operations.ProjectsClassicMoveCard.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + public func projectsClassicGetColumn( + path: Operations.ProjectsClassicGetColumn.Input.Path, + headers: Operations.ProjectsClassicGetColumn.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGetColumn.Output { + try await projectsClassicGetColumn(Operations.ProjectsClassicGetColumn.Input( + path: path, + headers: headers + )) + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + public func projectsClassicUpdateColumn( + path: Operations.ProjectsClassicUpdateColumn.Input.Path, + headers: Operations.ProjectsClassicUpdateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateColumn.Input.Body + ) async throws -> Operations.ProjectsClassicUpdateColumn.Output { + try await projectsClassicUpdateColumn(Operations.ProjectsClassicUpdateColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + public func projectsClassicDeleteColumn( + path: Operations.ProjectsClassicDeleteColumn.Input.Path, + headers: Operations.ProjectsClassicDeleteColumn.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicDeleteColumn.Output { + try await projectsClassicDeleteColumn(Operations.ProjectsClassicDeleteColumn.Input( + path: path, + headers: headers + )) + } + /// List project cards + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)`. + @available(*, deprecated) + public func projectsClassicListCards( + path: Operations.ProjectsClassicListCards.Input.Path, + query: Operations.ProjectsClassicListCards.Input.Query = .init(), + headers: Operations.ProjectsClassicListCards.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListCards.Output { + try await projectsClassicListCards(Operations.ProjectsClassicListCards.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)`. + @available(*, deprecated) + public func projectsClassicCreateCard( + path: Operations.ProjectsClassicCreateCard.Input.Path, + headers: Operations.ProjectsClassicCreateCard.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateCard.Input.Body + ) async throws -> Operations.ProjectsClassicCreateCard.Output { + try await projectsClassicCreateCard(Operations.ProjectsClassicCreateCard.Input( + path: path, + headers: headers, + body: body + )) + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + public func projectsClassicMoveColumn( + path: Operations.ProjectsClassicMoveColumn.Input.Path, + headers: Operations.ProjectsClassicMoveColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveColumn.Input.Body + ) async throws -> Operations.ProjectsClassicMoveColumn.Output { + try await projectsClassicMoveColumn(Operations.ProjectsClassicMoveColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + public func projectsClassicGet( + path: Operations.ProjectsClassicGet.Input.Path, + headers: Operations.ProjectsClassicGet.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGet.Output { + try await projectsClassicGet(Operations.ProjectsClassicGet.Input( + path: path, + headers: headers + )) + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + public func projectsClassicUpdate( + path: Operations.ProjectsClassicUpdate.Input.Path, + headers: Operations.ProjectsClassicUpdate.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdate.Input.Body? = nil + ) async throws -> Operations.ProjectsClassicUpdate.Output { + try await projectsClassicUpdate(Operations.ProjectsClassicUpdate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + public func projectsClassicDelete( + path: Operations.ProjectsClassicDelete.Input.Path, + headers: Operations.ProjectsClassicDelete.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicDelete.Output { + try await projectsClassicDelete(Operations.ProjectsClassicDelete.Input( + path: path, + headers: headers + )) + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + public func projectsClassicListCollaborators( + path: Operations.ProjectsClassicListCollaborators.Input.Path, + query: Operations.ProjectsClassicListCollaborators.Input.Query = .init(), + headers: Operations.ProjectsClassicListCollaborators.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListCollaborators.Output { + try await projectsClassicListCollaborators(Operations.ProjectsClassicListCollaborators.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + public func projectsClassicAddCollaborator( + path: Operations.ProjectsClassicAddCollaborator.Input.Path, + headers: Operations.ProjectsClassicAddCollaborator.Input.Headers = .init(), + body: Operations.ProjectsClassicAddCollaborator.Input.Body? = nil + ) async throws -> Operations.ProjectsClassicAddCollaborator.Output { + try await projectsClassicAddCollaborator(Operations.ProjectsClassicAddCollaborator.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + public func projectsClassicRemoveCollaborator( + path: Operations.ProjectsClassicRemoveCollaborator.Input.Path, + headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output { + try await projectsClassicRemoveCollaborator(Operations.ProjectsClassicRemoveCollaborator.Input( + path: path, + headers: headers + )) + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + public func projectsClassicGetPermissionForUser( + path: Operations.ProjectsClassicGetPermissionForUser.Input.Path, + headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output { + try await projectsClassicGetPermissionForUser(Operations.ProjectsClassicGetPermissionForUser.Input( + path: path, + headers: headers + )) + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + public func projectsClassicListColumns( + path: Operations.ProjectsClassicListColumns.Input.Path, + query: Operations.ProjectsClassicListColumns.Input.Query = .init(), + headers: Operations.ProjectsClassicListColumns.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListColumns.Output { + try await projectsClassicListColumns(Operations.ProjectsClassicListColumns.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + public func projectsClassicCreateColumn( + path: Operations.ProjectsClassicCreateColumn.Input.Path, + headers: Operations.ProjectsClassicCreateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateColumn.Input.Body + ) async throws -> Operations.ProjectsClassicCreateColumn.Output { + try await projectsClassicCreateColumn(Operations.ProjectsClassicCreateColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + public func projectsClassicListForRepo( + path: Operations.ProjectsClassicListForRepo.Input.Path, + query: Operations.ProjectsClassicListForRepo.Input.Query = .init(), + headers: Operations.ProjectsClassicListForRepo.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForRepo.Output { + try await projectsClassicListForRepo(Operations.ProjectsClassicListForRepo.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + public func projectsClassicCreateForRepo( + path: Operations.ProjectsClassicCreateForRepo.Input.Path, + headers: Operations.ProjectsClassicCreateForRepo.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForRepo.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForRepo.Output { + try await projectsClassicCreateForRepo(Operations.ProjectsClassicCreateForRepo.Input( + path: path, + headers: headers, + body: body + )) + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + public func projectsClassicCreateForAuthenticatedUser( + headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output { + try await projectsClassicCreateForAuthenticatedUser(Operations.ProjectsClassicCreateForAuthenticatedUser.Input( + headers: headers, + body: body + )) + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + public func projectsClassicListForUser( + path: Operations.ProjectsClassicListForUser.Input.Path, + query: Operations.ProjectsClassicListForUser.Input.Query = .init(), + headers: Operations.ProjectsClassicListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForUser.Output { + try await projectsClassicListForUser(Operations.ProjectsClassicListForUser.Input( + path: path, + query: query, + headers: headers + )) + } +} + +/// 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 { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `SimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Validation Error Simple + /// + /// - Remark: Generated from `#/components/schemas/validation-error-simple`. + public struct ValidationErrorSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. + public var errors: [Swift.String]? + /// Creates a new `ValidationErrorSimple`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct NullableSimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `NullableSimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Projects are a way to organize columns and cards of work. + /// + /// - Remark: Generated from `#/components/schemas/project`. + public struct Project: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project/owner_url`. + public var ownerUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/project/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/columns_url`. + public var columnsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/project/node_id`. + public var nodeId: Swift.String + /// Name of the project + /// + /// - Remark: Generated from `#/components/schemas/project/name`. + public var name: Swift.String + /// Body of the project + /// + /// - Remark: Generated from `#/components/schemas/project/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/project/number`. + public var number: Swift.Int + /// State of the project; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/components/schemas/project/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/project/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/project/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/project/updated_at`. + public var updatedAt: Foundation.Date + /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/organization_permission`. + @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" + } + /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/organization_permission`. + public var organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? + /// Whether or not this project can be seen by everyone. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/private`. + public var _private: Swift.Bool? + /// Creates a new `Project`. + /// + /// - Parameters: + /// - ownerUrl: + /// - url: + /// - htmlUrl: + /// - columnsUrl: + /// - id: + /// - nodeId: + /// - name: Name of the project + /// - body: Body of the project + /// - number: + /// - state: State of the project; either 'open' or 'closed' + /// - creator: + /// - createdAt: + /// - updatedAt: + /// - organizationPermission: The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// - _private: Whether or not this project can be seen by everyone. Only present if owner is an organization. + public init( + ownerUrl: Swift.String, + url: Swift.String, + htmlUrl: Swift.String, + columnsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + body: Swift.String? = nil, + number: Swift.Int, + state: Swift.String, + creator: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? = nil, + _private: Swift.Bool? = nil + ) { + self.ownerUrl = ownerUrl + self.url = url + self.htmlUrl = htmlUrl + self.columnsUrl = columnsUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.body = body + self.number = number + self.state = state + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.organizationPermission = organizationPermission + self._private = _private + } + public enum CodingKeys: String, CodingKey { + case ownerUrl = "owner_url" + case url + case htmlUrl = "html_url" + case columnsUrl = "columns_url" + case id + case nodeId = "node_id" + case name + case body + case number + case state + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case organizationPermission = "organization_permission" + case _private = "private" + } + } + /// Project cards represent a scope of work. + /// + /// - Remark: Generated from `#/components/schemas/project-card`. + public struct ProjectCard: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project-card/url`. + public var url: Swift.String + /// The project card's ID + /// + /// - Remark: Generated from `#/components/schemas/project-card/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/project-card/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/project-card/note`. + public var note: Swift.String? + /// - Remark: Generated from `#/components/schemas/project-card/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/project-card/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/project-card/updated_at`. + public var updatedAt: Foundation.Date + /// Whether or not the card is archived + /// + /// - Remark: Generated from `#/components/schemas/project-card/archived`. + public var archived: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/project-card/column_name`. + public var columnName: Swift.String? + /// - Remark: Generated from `#/components/schemas/project-card/project_id`. + public var projectId: Swift.String? + /// - Remark: Generated from `#/components/schemas/project-card/column_url`. + public var columnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project-card/content_url`. + public var contentUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/project-card/project_url`. + public var projectUrl: Swift.String + /// Creates a new `ProjectCard`. + /// + /// - Parameters: + /// - url: + /// - id: The project card's ID + /// - nodeId: + /// - note: + /// - creator: + /// - createdAt: + /// - updatedAt: + /// - archived: Whether or not the card is archived + /// - columnName: + /// - projectId: + /// - columnUrl: + /// - contentUrl: + /// - projectUrl: + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + note: Swift.String? = nil, + creator: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + archived: Swift.Bool? = nil, + columnName: Swift.String? = nil, + projectId: Swift.String? = nil, + columnUrl: Swift.String, + contentUrl: Swift.String? = nil, + projectUrl: Swift.String + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.note = note + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.archived = archived + self.columnName = columnName + self.projectId = projectId + self.columnUrl = columnUrl + self.contentUrl = contentUrl + self.projectUrl = projectUrl + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case note + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case archived + case columnName = "column_name" + case projectId = "project_id" + case columnUrl = "column_url" + case contentUrl = "content_url" + case projectUrl = "project_url" + } + } + /// Project columns contain cards of work. + /// + /// - Remark: Generated from `#/components/schemas/project-column`. + public struct ProjectColumn: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project-column/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/project_url`. + public var projectUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/cards_url`. + public var cardsUrl: Swift.String + /// The unique identifier of the project column + /// + /// - Remark: Generated from `#/components/schemas/project-column/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/project-column/node_id`. + public var nodeId: Swift.String + /// Name of the project column + /// + /// - Remark: Generated from `#/components/schemas/project-column/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/project-column/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectColumn`. + /// + /// - Parameters: + /// - url: + /// - projectUrl: + /// - cardsUrl: + /// - id: The unique identifier of the project column + /// - nodeId: + /// - name: Name of the project column + /// - createdAt: + /// - updatedAt: + public init( + url: Swift.String, + projectUrl: Swift.String, + cardsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.url = url + self.projectUrl = projectUrl + self.cardsUrl = cardsUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case url + case projectUrl = "project_url" + case cardsUrl = "cards_url" + case id + case nodeId = "node_id" + case name + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// Project Collaborator Permission + /// + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission`. + public struct ProjectCollaboratorPermission: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `ProjectCollaboratorPermission`. + /// + /// - Parameters: + /// - permission: + /// - user: + public init( + permission: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.permission = permission + self.user = user + } + public enum CodingKeys: String, CodingKey { + case permission + case user + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/components/parameters/project-id`. + public typealias ProjectId = Swift.Int + /// The unique identifier of the card. + /// + /// - Remark: Generated from `#/components/parameters/card-id`. + public typealias CardId = Swift.Int + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/components/parameters/column-id`. + public typealias ColumnId = Swift.Int + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct Gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Gone.Body + /// Creates a new `Gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Gone.Body) { + self.body = body + } + } + } + /// 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 organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + public enum ProjectsClassicListForOrg { + public static let id: Swift.String = "projects-classic/list-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsClassicListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForOrg.Input.Query.StatePayload? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Operations.ProjectsClassicListForOrg.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForOrg.Input.Path, + query: Operations.ProjectsClassicListForOrg.Input.Query = .init(), + headers: Operations.ProjectsClassicListForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForOrg.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.ProjectsClassicListForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + public enum ProjectsClassicCreateForOrg { + public static let id: Swift.String = "projects-classic/create-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsClassicCreateForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// The description of the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the project. + /// - body: The description of the project. + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateForOrg.Input.Path, + headers: Operations.ProjectsClassicCreateForOrg.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForOrg.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.ProjectsClassicCreateForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)`. + public enum ProjectsClassicGetCard { + public static let id: Swift.String = "projects-classic/get-card" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the card. + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path/card_id`. + public var cardId: Components.Parameters.CardId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - cardId: The unique identifier of the card. + public init(cardId: Components.Parameters.CardId) { + self.cardId = cardId + } + } + public var path: Operations.ProjectsClassicGetCard.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGetCard.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGetCard.Input.Path, + headers: Operations.ProjectsClassicGetCard.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectCard) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectCard { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGetCard.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGetCard.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGetCard.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.ProjectsClassicGetCard.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an existing project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)`. + public enum ProjectsClassicUpdateCard { + public static let id: Swift.String = "projects-classic/update-card" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the card. + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path/card_id`. + public var cardId: Components.Parameters.CardId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - cardId: The unique identifier of the card. + public init(cardId: Components.Parameters.CardId) { + self.cardId = cardId + } + } + public var path: Operations.ProjectsClassicUpdateCard.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicUpdateCard.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The project card's note + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/note`. + public var note: Swift.String? + /// Whether or not the card is archived + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/archived`. + public var archived: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - note: The project card's note + /// - archived: Whether or not the card is archived + public init( + note: Swift.String? = nil, + archived: Swift.Bool? = nil + ) { + self.note = note + self.archived = archived + } + public enum CodingKeys: String, CodingKey { + case note + case archived + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdateCard.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicUpdateCard.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicUpdateCard.Input.Path, + headers: Operations.ProjectsClassicUpdateCard.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateCard.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectCard) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectCard { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicUpdateCard.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.ProjectsClassicUpdateCard.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)`. + public enum ProjectsClassicDeleteCard { + public static let id: Swift.String = "projects-classic/delete-card" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the card. + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path/card_id`. + public var cardId: Components.Parameters.CardId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - cardId: The unique identifier of the card. + public init(cardId: Components.Parameters.CardId) { + self.cardId = cardId + } + } + public var path: Operations.ProjectsClassicDeleteCard.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicDeleteCard.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicDeleteCard.Input.Path, + headers: Operations.ProjectsClassicDeleteCard.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicDeleteCard.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicDeleteCard.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/errors`. + public var errors: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicDeleteCard.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicDeleteCard.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicDeleteCard.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Move a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)`. + public enum ProjectsClassicMoveCard { + public static let id: Swift.String = "projects-classic/move-card" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the card. + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path/card_id`. + public var cardId: Components.Parameters.CardId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - cardId: The unique identifier of the card. + public init(cardId: Components.Parameters.CardId) { + self.cardId = cardId + } + } + public var path: Operations.ProjectsClassicMoveCard.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicMoveCard.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/position`. + public var position: Swift.String + /// The unique identifier of the column the card should be moved to + /// + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/column_id`. + public var columnId: Swift.Int? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - position: The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. + /// - columnId: The unique identifier of the column the card should be moved to + public init( + position: Swift.String, + columnId: Swift.Int? = nil + ) { + self.position = position + self.columnId = columnId + } + public enum CodingKeys: String, CodingKey { + case position + case columnId = "column_id" + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicMoveCard.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicMoveCard.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicMoveCard.Input.Path, + headers: Operations.ProjectsClassicMoveCard.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveCard.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Creates a new `JsonPayload`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/application\/json`. + case json(Operations.ProjectsClassicMoveCard.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicMoveCard.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicMoveCard.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicMoveCard.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicMoveCard.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.ProjectsClassicMoveCard.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/field`. + public var field: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - resource: + /// - field: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + resource: Swift.String? = nil, + field: Swift.String? = nil + ) { + self.code = code + self.message = message + self.resource = resource + self.field = field + } + public enum CodingKeys: String, CodingKey { + case code + case message + case resource + case field + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. + public var errors: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicMoveCard.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicMoveCard.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicMoveCard.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. + public typealias ErrorsPayload = [Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. + public var errors: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.code = code + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case code + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/application\/json`. + case json(Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ProjectsClassicMoveCard.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects-classic/move-card)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + public enum ProjectsClassicGetColumn { + public static let id: Swift.String = "projects-classic/get-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicGetColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGetColumn.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGetColumn.Input.Path, + headers: Operations.ProjectsClassicGetColumn.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGetColumn.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGetColumn.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGetColumn.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.ProjectsClassicGetColumn.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + public enum ProjectsClassicUpdateColumn { + public static let id: Swift.String = "projects-classic/update-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicUpdateColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicUpdateColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project column + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project column + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdateColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicUpdateColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicUpdateColumn.Input.Path, + headers: Operations.ProjectsClassicUpdateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicUpdateColumn.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.ProjectsClassicUpdateColumn.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + public enum ProjectsClassicDeleteColumn { + public static let id: Swift.String = "projects-classic/delete-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicDeleteColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicDeleteColumn.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicDeleteColumn.Input.Path, + headers: Operations.ProjectsClassicDeleteColumn.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicDeleteColumn.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicDeleteColumn.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project cards + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)`. + public enum ProjectsClassicListCards { + public static let id: Swift.String = "projects-classic/list-cards" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicListCards.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. + @frozen public enum ArchivedStatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case archived = "archived" + case notArchived = "not_archived" + } + /// Filters the project cards that are returned by the card's state. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. + public var archivedState: Operations.ProjectsClassicListCards.Input.Query.ArchivedStatePayload? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - archivedState: Filters the project cards that are returned by the card's state. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + archivedState: Operations.ProjectsClassicListCards.Input.Query.ArchivedStatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.archivedState = archivedState + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListCards.Input.Query + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListCards.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListCards.Input.Path, + query: Operations.ProjectsClassicListCards.Input.Query = .init(), + headers: Operations.ProjectsClassicListCards.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListCards.Output.Ok.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectCard]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectCard] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListCards.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListCards.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListCards.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListCards.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.ProjectsClassicListCards.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects-classic/list-cards)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a project card + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)`. + public enum ProjectsClassicCreateCard { + public static let id: Swift.String = "projects-classic/create-card" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicCreateCard.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateCard.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The project card's note + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1/note`. + public var note: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - note: The project card's note + public init(note: Swift.String? = nil) { + self.note = note + } + public enum CodingKeys: String, CodingKey { + case note + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. + case case1(Operations.ProjectsClassicCreateCard.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// The unique identifier of the content associated with the card + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_id`. + public var contentId: Swift.Int + /// The piece of content associated with the card + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_type`. + public var contentType: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - contentId: The unique identifier of the content associated with the card + /// - contentType: The piece of content associated with the card + public init( + contentId: Swift.Int, + contentType: Swift.String + ) { + self.contentId = contentId + self.contentType = contentType + } + public enum CodingKeys: String, CodingKey { + case contentId = "content_id" + case contentType = "content_type" + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. + case case2(Operations.ProjectsClassicCreateCard.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateCard.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateCard.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateCard.Input.Path, + headers: Operations.ProjectsClassicCreateCard.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateCard.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectCard) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectCard { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateCard.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateCard.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateCard.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.ProjectsClassicCreateCard.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case1`. + case ValidationError(Components.Schemas.ValidationError) + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case2`. + case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .ValidationError(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ValidationErrorSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .ValidationError(value): + try value.encode(to: encoder) + case let .ValidationErrorSimple(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/application\/json`. + case json(Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateCard.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.ProjectsClassicCreateCard.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.ProjectsClassicCreateCard.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. + public typealias ErrorsPayload = [Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. + public var errors: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.code = code + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case code + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/application\/json`. + case json(Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects-classic/create-card)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ProjectsClassicCreateCard.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + public enum ProjectsClassicMoveColumn { + public static let id: Swift.String = "projects-classic/move-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicMoveColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicMoveColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json/position`. + public var position: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - position: The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + public init(position: Swift.String) { + self.position = position + } + public enum CodingKeys: String, CodingKey { + case position + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicMoveColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicMoveColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicMoveColumn.Input.Path, + headers: Operations.ProjectsClassicMoveColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Creates a new `JsonPayload`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/application\/json`. + case json(Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicMoveColumn.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicMoveColumn.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicMoveColumn.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.ProjectsClassicMoveColumn.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + public enum ProjectsClassicGet { + public static let id: Swift.String = "projects-classic/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicGet.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGet.Input.Path, + headers: Operations.ProjectsClassicGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGet.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.ProjectsClassicGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + public enum ProjectsClassicUpdate { + public static let id: Swift.String = "projects-classic/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicUpdate.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicUpdate.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// Body of the project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/body`. + public var body: Swift.String? + /// State of the project; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/state`. + public var state: Swift.String? + /// The baseline permission that all organization members have on this project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. + @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" + } + /// The baseline permission that all organization members have on this project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. + public var organizationPermission: Operations.ProjectsClassicUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? + /// Whether or not this project can be seen by everyone. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/private`. + public var _private: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project + /// - body: Body of the project + /// - state: State of the project; either 'open' or 'closed' + /// - organizationPermission: The baseline permission that all organization members have on this project + /// - _private: Whether or not this project can be seen by everyone. + public init( + name: Swift.String? = nil, + body: Swift.String? = nil, + state: Swift.String? = nil, + organizationPermission: Operations.ProjectsClassicUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? = nil, + _private: Swift.Bool? = nil + ) { + self.name = name + self.body = body + self.state = state + self.organizationPermission = organizationPermission + self._private = _private + } + public enum CodingKeys: String, CodingKey { + case name + case body + case state + case organizationPermission = "organization_permission" + case _private = "private" + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdate.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicUpdate.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicUpdate.Input.Path, + headers: Operations.ProjectsClassicUpdate.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdate.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdate.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicUpdate.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.ProjectsClassicUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if the authenticated user does not have access to the project + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ProjectsClassicUpdate.Output.NotFound) + /// Not Found if the authenticated user does not have access to the project + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ProjectsClassicUpdate.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/errors`. + public var errors: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicUpdate.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicUpdate.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + public enum ProjectsClassicDelete { + public static let id: Swift.String = "projects-classic/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicDelete.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicDelete.Input.Path, + headers: Operations.ProjectsClassicDelete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Delete Success + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicDelete.Output.NoContent) + /// Delete Success + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/errors`. + public var errors: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicDelete.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicDelete.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicDelete.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicDelete.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + public enum ProjectsClassicListCollaborators { + public static let id: Swift.String = "projects-classic/list-collaborators" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicListCollaborators.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. + @frozen public enum AffiliationPayload: String, Codable, Hashable, Sendable, CaseIterable { + case outside = "outside" + case direct = "direct" + case all = "all" + } + /// Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. + public var affiliation: Operations.ProjectsClassicListCollaborators.Input.Query.AffiliationPayload? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - affiliation: Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + affiliation: Operations.ProjectsClassicListCollaborators.Input.Query.AffiliationPayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.affiliation = affiliation + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListCollaborators.Input.Query + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListCollaborators.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListCollaborators.Input.Path, + query: Operations.ProjectsClassicListCollaborators.Input.Query = .init(), + headers: Operations.ProjectsClassicListCollaborators.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListCollaborators.Output.Ok.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListCollaborators.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListCollaborators.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListCollaborators.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListCollaborators.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.ProjectsClassicListCollaborators.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + public enum ProjectsClassicAddCollaborator { + public static let id: Swift.String = "projects-classic/add-collaborator" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicAddCollaborator.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicAddCollaborator.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The permission to grant the collaborator. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. + @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + } + /// The permission to grant the collaborator. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. + public var permission: Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload.PermissionPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - permission: The permission to grant the collaborator. + public init(permission: Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload.PermissionPayload? = nil) { + self.permission = permission + } + public enum CodingKeys: String, CodingKey { + case permission + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicAddCollaborator.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicAddCollaborator.Input.Path, + headers: Operations.ProjectsClassicAddCollaborator.Input.Headers = .init(), + body: Operations.ProjectsClassicAddCollaborator.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicAddCollaborator.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicAddCollaborator.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + public enum ProjectsClassicRemoveCollaborator { + public static let id: Swift.String = "projects-classic/remove-collaborator" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicRemoveCollaborator.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicRemoveCollaborator.Input.Path, + headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicRemoveCollaborator.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicRemoveCollaborator.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + public enum ProjectsClassicGetPermissionForUser { + public static let id: Swift.String = "projects-classic/get-permission-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicGetPermissionForUser.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGetPermissionForUser.Input.Path, + headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectCollaboratorPermission) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectCollaboratorPermission { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGetPermissionForUser.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.ProjectsClassicGetPermissionForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + public enum ProjectsClassicListColumns { + public static let id: Swift.String = "projects-classic/list-columns" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicListColumns.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListColumns.Input.Query + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListColumns.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListColumns.Input.Path, + query: Operations.ProjectsClassicListColumns.Input.Query = .init(), + headers: Operations.ProjectsClassicListColumns.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListColumns.Output.Ok.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectColumn]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectColumn] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListColumns.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListColumns.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListColumns.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListColumns.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.ProjectsClassicListColumns.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + public enum ProjectsClassicCreateColumn { + public static let id: Swift.String = "projects-classic/create-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicCreateColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project column + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project column + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateColumn.Input.Path, + headers: Operations.ProjectsClassicCreateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateColumn.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateColumn.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateColumn.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.ProjectsClassicCreateColumn.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + public enum ProjectsClassicListForRepo { + public static let id: Swift.String = "projects-classic/list-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ProjectsClassicListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForRepo.Input.Query.StatePayload? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Operations.ProjectsClassicListForRepo.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForRepo.Input.Path, + query: Operations.ProjectsClassicListForRepo.Input.Query = .init(), + headers: Operations.ProjectsClassicListForRepo.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForRepo.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForRepo.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.ProjectsClassicListForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + public enum ProjectsClassicCreateForRepo { + public static let id: Swift.String = "projects-classic/create-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ProjectsClassicCreateForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the project. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// The description of the project. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the project. + /// - body: The description of the project. + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForRepo.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateForRepo.Input.Path, + headers: Operations.ProjectsClassicCreateForRepo.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForRepo.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForRepo.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.ProjectsClassicCreateForRepo.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + public enum ProjectsClassicCreateForAuthenticatedUser { + public static let id: Swift.String = "projects-classic/create-for-authenticated-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project + /// + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// Body of the project + /// + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project + /// - body: Body of the project + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForAuthenticatedUser.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.ProjectsClassicCreateForAuthenticatedUser.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + public enum ProjectsClassicListForUser { + public static let id: Swift.String = "projects-classic/list-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsClassicListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForUser.Input.Query.StatePayload? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Operations.ProjectsClassicListForUser.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForUser.Input.Path, + query: Operations.ProjectsClassicListForUser.Input.Query = .init(), + headers: Operations.ProjectsClassicListForUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForUser.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.ProjectsClassicListForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 60d793b703..c3a7665aec 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -8568,6 +8568,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -8588,6 +8593,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -8733,7 +8743,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -12049,7 +12059,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. public var allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? - /// Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. public var automaticCopilotCodeReviewEnabled: Swift.Bool? @@ -12077,7 +12087,7 @@ public enum Components { /// /// - Parameters: /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - automaticCopilotCodeReviewEnabled: Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. + /// - automaticCopilotCodeReviewEnabled: Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. @@ -13502,6 +13512,223 @@ public enum Components { case updatedAt = "updated_at" } } + /// A repository rule. + /// + /// - Remark: Generated from `#/components/schemas/org-rules`. + @frozen public enum OrgRules: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-rules/case1`. + case RepositoryRuleCreation(Components.Schemas.RepositoryRuleCreation) + /// - Remark: Generated from `#/components/schemas/org-rules/case2`. + case RepositoryRuleUpdate(Components.Schemas.RepositoryRuleUpdate) + /// - Remark: Generated from `#/components/schemas/org-rules/case3`. + case RepositoryRuleDeletion(Components.Schemas.RepositoryRuleDeletion) + /// - Remark: Generated from `#/components/schemas/org-rules/case4`. + case RepositoryRuleRequiredLinearHistory(Components.Schemas.RepositoryRuleRequiredLinearHistory) + /// - Remark: Generated from `#/components/schemas/org-rules/case5`. + case RepositoryRuleRequiredDeployments(Components.Schemas.RepositoryRuleRequiredDeployments) + /// - Remark: Generated from `#/components/schemas/org-rules/case6`. + case RepositoryRuleRequiredSignatures(Components.Schemas.RepositoryRuleRequiredSignatures) + /// - Remark: Generated from `#/components/schemas/org-rules/case7`. + case RepositoryRulePullRequest(Components.Schemas.RepositoryRulePullRequest) + /// - Remark: Generated from `#/components/schemas/org-rules/case8`. + case RepositoryRuleRequiredStatusChecks(Components.Schemas.RepositoryRuleRequiredStatusChecks) + /// - Remark: Generated from `#/components/schemas/org-rules/case9`. + case RepositoryRuleNonFastForward(Components.Schemas.RepositoryRuleNonFastForward) + /// - Remark: Generated from `#/components/schemas/org-rules/case10`. + case RepositoryRuleCommitMessagePattern(Components.Schemas.RepositoryRuleCommitMessagePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case11`. + case RepositoryRuleCommitAuthorEmailPattern(Components.Schemas.RepositoryRuleCommitAuthorEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case12`. + case RepositoryRuleCommitterEmailPattern(Components.Schemas.RepositoryRuleCommitterEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case13`. + case RepositoryRuleBranchNamePattern(Components.Schemas.RepositoryRuleBranchNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case14`. + case RepositoryRuleTagNamePattern(Components.Schemas.RepositoryRuleTagNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case15`. + case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case16`. + case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) + /// - Remark: Generated from `#/components/schemas/org-rules/case17`. + case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case18`. + case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) + /// - Remark: Generated from `#/components/schemas/org-rules/case19`. + case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) + /// - Remark: Generated from `#/components/schemas/org-rules/case20`. + case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .RepositoryRuleCreation(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleUpdate(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleDeletion(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredLinearHistory(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredDeployments(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredSignatures(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRulePullRequest(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredStatusChecks(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleNonFastForward(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitMessagePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitAuthorEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitterEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleBranchNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleTagNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFilePathRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFilePathLength(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFileExtensionRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFileSize(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleWorkflows(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCodeScanning(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .RepositoryRuleCreation(value): + try value.encode(to: encoder) + case let .RepositoryRuleUpdate(value): + try value.encode(to: encoder) + case let .RepositoryRuleDeletion(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredLinearHistory(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredDeployments(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredSignatures(value): + try value.encode(to: encoder) + case let .RepositoryRulePullRequest(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredStatusChecks(value): + try value.encode(to: encoder) + case let .RepositoryRuleNonFastForward(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitMessagePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitAuthorEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitterEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleBranchNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleTagNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleFilePathRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFilePathLength(value): + try value.encode(to: encoder) + case let .RepositoryRuleFileExtensionRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFileSize(value): + try value.encode(to: encoder) + case let .RepositoryRuleWorkflows(value): + try value.encode(to: encoder) + case let .RepositoryRuleCodeScanning(value): + try value.encode(to: encoder) + } + } + } /// - Remark: Generated from `#/components/schemas/RuleSuites`. public struct RuleSuitesPayload: Codable, Hashable, Sendable { /// The unique identifier of the rule insight. @@ -20292,7 +20519,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/deploy-key/added_by`. public var addedBy: Swift.String? /// - Remark: Generated from `#/components/schemas/deploy-key/last_used`. - public var lastUsed: Swift.String? + public var lastUsed: Foundation.Date? /// - Remark: Generated from `#/components/schemas/deploy-key/enabled`. public var enabled: Swift.Bool? /// Creates a new `DeployKey`. @@ -20317,7 +20544,7 @@ public enum Components { createdAt: Swift.String, readOnly: Swift.Bool, addedBy: Swift.String? = nil, - lastUsed: Swift.String? = nil, + lastUsed: Foundation.Date? = nil, enabled: Swift.Bool? = nil ) { self.id = id @@ -21351,6 +21578,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/release/prerelease`. public var prerelease: Swift.Bool + /// Whether or not the release is immutable. + /// + /// - Remark: Generated from `#/components/schemas/release/immutable`. + public var immutable: Swift.Bool? /// - Remark: Generated from `#/components/schemas/release/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/release/published_at`. @@ -21388,6 +21619,7 @@ public enum Components { /// - body: /// - draft: true to create a draft (unpublished) release, false to create a published one. /// - prerelease: Whether to identify the release as a prerelease or a full release. + /// - immutable: Whether or not the release is immutable. /// - createdAt: /// - publishedAt: /// - author: @@ -21412,6 +21644,7 @@ public enum Components { body: Swift.String? = nil, draft: Swift.Bool, prerelease: Swift.Bool, + immutable: Swift.Bool? = nil, createdAt: Foundation.Date, publishedAt: Foundation.Date? = nil, author: Components.Schemas.SimpleUser, @@ -21436,6 +21669,7 @@ public enum Components { self.body = body self.draft = draft self.prerelease = prerelease + self.immutable = immutable self.createdAt = createdAt self.publishedAt = publishedAt self.author = author @@ -21461,6 +21695,7 @@ public enum Components { case body case draft case prerelease + case immutable case createdAt = "created_at" case publishedAt = "published_at" case author @@ -24395,7 +24630,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -24411,7 +24646,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target @@ -25293,7 +25528,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -25309,7 +25544,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement? = nil, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target @@ -25948,7 +26183,11 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis`. public struct SecurityAndAnalysisPayload: Codable, Hashable, Sendable { - /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. + /// For more information, see "[About GitHub Advanced + /// Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { @@ -25967,7 +26206,11 @@ public enum Operations { case status } } - /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. + /// For more information, see "[About GitHub Advanced + /// Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/advanced_security`. public var advancedSecurity: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.AdvancedSecurityPayload? @@ -26089,7 +26332,7 @@ public enum Operations { /// Creates a new `SecurityAndAnalysisPayload`. /// /// - Parameters: - /// - advancedSecurity: Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// - advancedSecurity: Use the `status` property to enable or disable GitHub Advanced Security for this repository. /// - codeSecurity: Use the `status` property to enable or disable GitHub Code Security for this repository. /// - secretScanning: Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." /// - secretScanningPushProtection: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 87e5247004..4436fe2a88 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -2262,8 +2262,42 @@ public enum Components { case rocket } } + /// - Remark: Generated from `#/components/schemas/sub-issues-summary`. + public struct SubIssuesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/total`. + public var total: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/completed`. + public var completed: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/percent_completed`. + public var percentCompleted: Swift.Int + /// Creates a new `SubIssuesSummary`. + /// + /// - Parameters: + /// - total: + /// - completed: + /// - percentCompleted: + public init( + total: Swift.Int, + completed: Swift.Int, + percentCompleted: Swift.Int + ) { + self.total = total + self.completed = completed + self.percentCompleted = percentCompleted + } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percentCompleted = "percent_completed" + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2284,6 +2318,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2429,7 +2468,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -3652,36 +3691,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue-search-result-item/labels`. public var labels: Components.Schemas.IssueSearchResultItem.LabelsPayload /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. - public struct SubIssuesSummaryPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/total`. - public var total: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/completed`. - public var completed: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/percent_completed`. - public var percentCompleted: Swift.Int - /// Creates a new `SubIssuesSummaryPayload`. - /// - /// - Parameters: - /// - total: - /// - completed: - /// - percentCompleted: - public init( - total: Swift.Int, - completed: Swift.Int, - percentCompleted: Swift.Int - ) { - self.total = total - self.completed = completed - self.percentCompleted = percentCompleted - } - public enum CodingKeys: String, CodingKey { - case total - case completed - case percentCompleted = "percent_completed" - } - } - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. - public var subIssuesSummary: Components.Schemas.IssueSearchResultItem.SubIssuesSummaryPayload? + public var subIssuesSummary: Components.Schemas.SubIssuesSummary? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state`. public var state: Swift.String /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state_reason`. @@ -3821,7 +3831,7 @@ public enum Components { assignees: [Components.Schemas.SimpleUser]? = nil, user: Components.Schemas.NullableSimpleUser? = nil, labels: Components.Schemas.IssueSearchResultItem.LabelsPayload, - subIssuesSummary: Components.Schemas.IssueSearchResultItem.SubIssuesSummaryPayload? = nil, + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, state: Swift.String, stateReason: Swift.String? = nil, assignee: Components.Schemas.NullableSimpleUser? = nil, diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index a074b03ae2..d02b33642d 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -2727,6 +2727,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2747,6 +2752,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2892,7 +2902,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 309709ae1e..4cf5f13b32 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -2611,6 +2611,11 @@ 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. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2631,6 +2636,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2776,7 +2786,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index f37397da92..4255294521 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -2631,6 +2631,8 @@ public enum Components { public var verified: Swift.Bool /// - Remark: Generated from `#/components/schemas/key/read_only`. public var readOnly: Swift.Bool + /// - Remark: Generated from `#/components/schemas/key/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `Key`. /// /// - Parameters: @@ -2641,6 +2643,7 @@ public enum Components { /// - createdAt: /// - verified: /// - readOnly: + /// - lastUsed: public init( key: Swift.String, id: Swift.Int64, @@ -2648,7 +2651,8 @@ public enum Components { title: Swift.String, createdAt: Foundation.Date, verified: Swift.Bool, - readOnly: Swift.Bool + readOnly: Swift.Bool, + lastUsed: Foundation.Date? = nil ) { self.key = key self.id = id @@ -2657,6 +2661,7 @@ public enum Components { self.createdAt = createdAt self.verified = verified self.readOnly = readOnly + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case key @@ -2666,6 +2671,7 @@ public enum Components { case createdAt = "created_at" case verified case readOnly = "read_only" + case lastUsed = "last_used" } } /// Social media account @@ -2782,25 +2788,31 @@ public enum Components { public var key: Swift.String /// - Remark: Generated from `#/components/schemas/key-simple/created_at`. public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/key-simple/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `KeySimple`. /// /// - Parameters: /// - id: /// - key: /// - createdAt: + /// - lastUsed: public init( id: Swift.Int, key: Swift.String, - createdAt: Foundation.Date? = nil + createdAt: Foundation.Date? = nil, + lastUsed: Foundation.Date? = nil ) { self.id = id self.key = key self.createdAt = createdAt + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case id case key case createdAt = "created_at" + case lastUsed = "last_used" } } } diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description deleted file mode 160000 index c52348cd88..0000000000 --- a/Submodule/github/rest-api-description +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c52348cd88be16e613e49c26b39d2653e20b817d