From c46c47ec323a265dea54c727c4979cf440fa9876 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:21:56 +0000 Subject: [PATCH 01/46] Bump Submodule/github/rest-api-description from `883ec92` to `f0dc156` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `883ec92` to `f0dc156`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/883ec926b6621250deaa3de639e53a42967d2639...f0dc156505ef3ea9ae0fd2f227aca5642c465e4f) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: f0dc156505ef3ea9ae0fd2f227aca5642c465e4f dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 883ec926b6..f0dc156505 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 883ec926b6621250deaa3de639e53a42967d2639 +Subproject commit f0dc156505ef3ea9ae0fd2f227aca5642c465e4f From 167d17884fc63903b3ea357ec75594aa00f915c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:47:31 +0000 Subject: [PATCH 02/46] Commit via running: make Sources/activity --- Sources/activity/Types.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index f0f027dd4c..1894e76094 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -3292,11 +3292,15 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. @@ -3340,6 +3344,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -3376,9 +3381,10 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -3418,6 +3424,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -3458,6 +3465,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } From 4214664223f82c8410bb2f606d44f319de1ae004 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:52:00 +0000 Subject: [PATCH 03/46] Commit via running: make Sources/issues --- Sources/issues/Client.swift | 139 ++++++++++++++++++ Sources/issues/Types.swift | 284 +++++++++++++++++++++++++++++++++++- 2 files changed, 419 insertions(+), 4 deletions(-) diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 2f5ad782cb..594e66de24 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -4450,6 +4450,145 @@ public struct Client: APIProtocol { } ) } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesGetParent.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/parent", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + 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.IssuesGetParent.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 9ae335f662..3062d39504 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -381,6 +381,20 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. func issuesUnlock(_ input: Operations.IssuesUnlock.Input) async throws -> Operations.IssuesUnlock.Output + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -1192,6 +1206,28 @@ extension APIProtocol { headers: headers )) } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public func issuesGetParent( + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.Input.Headers = .init() + ) async throws -> Operations.IssuesGetParent.Output { + try await issuesGetParent(Operations.IssuesGetParent.Input( + path: path, + headers: headers + )) + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -4200,11 +4236,15 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. @@ -4248,6 +4288,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -4284,9 +4325,10 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -4326,6 +4368,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -4366,6 +4409,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -5042,11 +5086,15 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/nullable-issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/nullable-issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/nullable-issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_dependencies_summary`. public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_field_values`. @@ -5090,6 +5138,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue /// - issueDependenciesSummary: /// - issueFieldValues: public init( @@ -5126,9 +5175,10 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { @@ -5168,6 +5218,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl self.issueDependenciesSummary = issueDependenciesSummary self.issueFieldValues = issueFieldValues } @@ -5208,6 +5259,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" case issueDependenciesSummary = "issue_dependencies_summary" case issueFieldValues = "issue_field_values" } @@ -17493,6 +17545,230 @@ public enum Operations { } } } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public enum IssuesGetParent { + public static let id: Swift.String = "issues/get-parent" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesGetParent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesGetParent.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGetParent.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGetParent.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGetParent.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesGetParent.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. From 3796e87173147827df60633161dc9b113cf55a74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:54:37 +0000 Subject: [PATCH 04/46] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 142 +++++++++ Sources/orgs/Types.swift | 597 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 739 insertions(+) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index dee0f32146..b8bd46122c 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -464,6 +464,148 @@ public struct Client: APIProtocol { } ) } + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCreateArtifactStorageRecord.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/metadata/storage-record", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListArtifactStorageRecords.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/{}/metadata/storage-records", + parameters: [ + input.path.org, + input.path.subjectDigest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List attestations by bulk subject digests /// /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index b708dfd4a1..e7be3d7e74 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -66,6 +66,24 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}`. /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. func orgsDelete(_ input: Operations.OrgsDelete.Input) async throws -> Operations.OrgsDelete.Output + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output /// List attestations by bulk subject digests /// /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. @@ -1001,6 +1019,42 @@ extension APIProtocol { headers: headers )) } + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public func orgsCreateArtifactStorageRecord( + path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, + headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + ) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { + try await orgsCreateArtifactStorageRecord(Operations.OrgsCreateArtifactStorageRecord.Input( + path: path, + headers: headers, + body: body + )) + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public func orgsListArtifactStorageRecords( + path: Operations.OrgsListArtifactStorageRecords.Input.Path, + headers: Operations.OrgsListArtifactStorageRecords.Input.Headers = .init() + ) async throws -> Operations.OrgsListArtifactStorageRecords.Output { + try await orgsListArtifactStorageRecords(Operations.OrgsListArtifactStorageRecords.Input( + path: path, + headers: headers + )) + } /// List attestations by bulk subject digests /// /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. @@ -10038,6 +10092,549 @@ public enum Operations { } } } + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public enum OrgsCreateArtifactStorageRecord { + public static let id: Swift.String = "orgs/create-artifact-storage-record" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsCreateArtifactStorageRecord.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/name`. + public var name: Swift.String + /// The digest of the artifact (algorithm:hex-encoded-digest). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/digest`. + public var digest: Swift.String + /// The URL where the artifact is stored. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/artifact_url`. + public var artifactUrl: Swift.String? + /// The path of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/path`. + public var path: Swift.String? + /// The base URL of the artifact registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/registry_url`. + public var registryUrl: Swift.String + /// The repository name within the registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/repository`. + public var repository: Swift.String? + /// The status of the artifact (e.g., active, inactive). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case eol = "eol" + case deleted = "deleted" + } + /// The status of the artifact (e.g., active, inactive). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + public var status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. + /// - digest: The digest of the artifact (algorithm:hex-encoded-digest). + /// - artifactUrl: The URL where the artifact is stored. + /// - path: The path of the artifact. + /// - registryUrl: The base URL of the artifact registry. + /// - repository: The repository name within the registry. + /// - status: The status of the artifact (e.g., active, inactive). + public init( + name: Swift.String, + digest: Swift.String, + artifactUrl: Swift.String? = nil, + path: Swift.String? = nil, + registryUrl: Swift.String, + repository: Swift.String? = nil, + status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? = nil + ) { + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.path = path + self.registryUrl = registryUrl + self.repository = repository + self.status = status + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case artifactUrl = "artifact_url" + case path + case registryUrl = "registry_url" + case repository + case status + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, + headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body) { + self.body = body + } + } + /// Artifact metadata storage record stored successfully. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCreateArtifactStorageRecord.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCreateArtifactStorageRecord.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public enum OrgsListArtifactStorageRecords { + public static let id: Swift.String = "orgs/list-artifact-storage-records" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/org`. + public var org: Components.Parameters.Org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsListArtifactStorageRecords.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListArtifactStorageRecords.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsListArtifactStorageRecords.Input.Path, + headers: Operations.OrgsListArtifactStorageRecords.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of storage records for this digest and organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of storage records for this digest and organization + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListArtifactStorageRecords.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListArtifactStorageRecords.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List attestations by bulk subject digests /// /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. From 1c5df02ad5ab7ab5050b39f45e73fc209103b567 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:55:22 +0000 Subject: [PATCH 05/46] Commit via running: make Sources/projects-classic --- Sources/projects-classic/Client.swift | 958 +-------- Sources/projects-classic/Types.swift | 2576 ++----------------------- 2 files changed, 158 insertions(+), 3376 deletions(-) diff --git a/Sources/projects-classic/Client.swift b/Sources/projects-classic/Client.swift index 6a350dafed..c8f33335d8 100644 --- a/Sources/projects-classic/Client.swift +++ b/Sources/projects-classic/Client.swift @@ -342,24 +342,24 @@ public struct Client: APIProtocol { } ) } - /// Get a project card + /// 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/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)`. + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. @available(*, deprecated) - public func projectsClassicGetCard(_ input: Operations.ProjectsClassicGetCard.Input) async throws -> Operations.ProjectsClassicGetCard.Output { + public func projectsClassicGetColumn(_ input: Operations.ProjectsClassicGetColumn.Input) async throws -> Operations.ProjectsClassicGetColumn.Output { try await client.send( input: input, - forOperation: Operations.ProjectsClassicGetCard.id, + forOperation: Operations.ProjectsClassicGetColumn.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", + template: "/projects/columns/{}", parameters: [ - input.path.cardId + input.path.columnId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -377,7 +377,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsClassicGetCard.Output.Ok.Body + let body: Operations.ProjectsClassicGetColumn.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -387,7 +387,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCard.self, + Components.Schemas.ProjectColumn.self, from: responseBody, transforming: { value in .json(value) @@ -421,9 +421,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 401: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -442,10 +442,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -464,7 +464,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -477,24 +477,24 @@ public struct Client: APIProtocol { } ) } - /// Update an existing project card + /// 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/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)`. + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. @available(*, deprecated) - public func projectsClassicUpdateCard(_ input: Operations.ProjectsClassicUpdateCard.Input) async throws -> Operations.ProjectsClassicUpdateCard.Output { + public func projectsClassicUpdateColumn(_ input: Operations.ProjectsClassicUpdateColumn.Input) async throws -> Operations.ProjectsClassicUpdateColumn.Output { try await client.send( input: input, - forOperation: Operations.ProjectsClassicUpdateCard.id, + forOperation: Operations.ProjectsClassicUpdateColumn.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", + template: "/projects/columns/{}", parameters: [ - input.path.cardId + input.path.columnId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -508,10 +508,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -523,7 +521,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body + let body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -533,7 +531,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCard.self, + Components.Schemas.ProjectColumn.self, from: responseBody, transforming: { value in .json(value) @@ -589,50 +587,6 @@ public struct Client: APIProtocol { 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, @@ -645,24 +599,24 @@ public struct Client: APIProtocol { } ) } - /// Delete a project card + /// 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/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)`. + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. @available(*, deprecated) - public func projectsClassicDeleteCard(_ input: Operations.ProjectsClassicDeleteCard.Input) async throws -> Operations.ProjectsClassicDeleteCard.Output { + public func projectsClassicDeleteColumn(_ input: Operations.ProjectsClassicDeleteColumn.Input) async throws -> Operations.ProjectsClassicDeleteColumn.Output { try await client.send( input: input, - forOperation: Operations.ProjectsClassicDeleteCard.id, + forOperation: Operations.ProjectsClassicDeleteColumn.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", + template: "/projects/columns/{}", parameters: [ - input.path.cardId + input.path.columnId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -684,51 +638,7 @@ public struct Client: APIProtocol { 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 body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -747,106 +657,6 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// 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) @@ -870,708 +680,6 @@ public struct Client: APIProtocol { 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, diff --git a/Sources/projects-classic/Types.swift b/Sources/projects-classic/Types.swift index 1f1851d56e..2ddc354a99 100644 --- a/Sources/projects-classic/Types.swift +++ b/Sources/projects-classic/Types.swift @@ -31,46 +31,6 @@ public protocol APIProtocol: Sendable { /// - 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] @@ -101,26 +61,6 @@ public protocol APIProtocol: Sendable { /// - 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] @@ -305,82 +245,6 @@ extension APIProtocol { 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] @@ -437,46 +301,6 @@ extension APIProtocol { 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] @@ -1377,101 +1201,6 @@ public enum Components { 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`. @@ -1593,10 +1322,6 @@ public enum Components { /// /// - 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`. @@ -2289,52 +2014,52 @@ public enum Operations { } } } - /// Get a project card + /// 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/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" + /// - 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/cards/{card_id}/GET/path`. + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the card. + /// The unique identifier of the column. /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path/card_id`. - public var cardId: Components.Parameters.CardId + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path/column_id`. + public var columnId: Components.Parameters.ColumnId /// Creates a new `Path`. /// /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId } } - public var path: Operations.ProjectsClassicGetCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/header`. + 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] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsClassicGetCard.Input.Headers + public var headers: Operations.ProjectsClassicGetColumn.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ProjectsClassicGetCard.Input.Path, - headers: Operations.ProjectsClassicGetCard.Input.Headers = .init() + path: Operations.ProjectsClassicGetColumn.Input.Path, + headers: Operations.ProjectsClassicGetColumn.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -2342,15 +2067,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/projects/columns/{column_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) + /// - 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.ProjectCard { + public var json: Components.Schemas.ProjectColumn { get throws { switch self { case let .json(body): @@ -2360,26 +2085,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsClassicGetCard.Output.Ok.Body + public var body: Operations.ProjectsClassicGetColumn.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ProjectsClassicGetCard.Output.Ok.Body) { + public init(body: Operations.ProjectsClassicGetColumn.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/200`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsClassicGetCard.Output.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.ProjectsClassicGetCard.Output.Ok { + public var ok: Operations.ProjectsClassicGetColumn.Output.Ok { get throws { switch self { case let .ok(response): @@ -2394,13 +2119,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/304`. + /// - 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/cards/{card_id}/get(projects-classic/get-card)/responses/304`. + /// - 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 { @@ -2425,7 +2150,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/403`. + /// - 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) @@ -2446,47 +2171,47 @@ public enum Operations { } } } - /// Requires authentication + /// Resource not found /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/401`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/404`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unauthorized(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects-classic/get-card)/responses/404`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/401`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .notFound(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unauthorized", response: self ) } @@ -2523,77 +2248,67 @@ public enum Operations { } } } - /// Update an existing project card + /// 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/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" + /// - 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/cards/{card_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the card. + /// The unique identifier of the column. /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path/card_id`. - public var cardId: Components.Parameters.CardId + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path/column_id`. + public var columnId: Components.Parameters.ColumnId /// Creates a new `Path`. /// /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId } } - public var path: Operations.ProjectsClassicUpdateCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/header`. + 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] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsClassicUpdateCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody`. + 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/cards/{card_id}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/projects/columns/{column_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 + /// Name of the project column /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/archived`. - public var archived: Swift.Bool? + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json/name`. + public var name: Swift.String /// 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 + /// - name: Name of the project column + public init(name: Swift.String) { + self.name = name } public enum CodingKeys: String, CodingKey { - case note - case archived + case name } } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsClassicUpdateCard.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdateColumn.Input.Body.JsonPayload) } - public var body: Operations.ProjectsClassicUpdateCard.Input.Body? + public var body: Operations.ProjectsClassicUpdateColumn.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -2601,9 +2316,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ProjectsClassicUpdateCard.Input.Path, - headers: Operations.ProjectsClassicUpdateCard.Input.Headers = .init(), - body: Operations.ProjectsClassicUpdateCard.Input.Body? = nil + path: Operations.ProjectsClassicUpdateColumn.Input.Path, + headers: Operations.ProjectsClassicUpdateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateColumn.Input.Body ) { self.path = path self.headers = headers @@ -2612,15 +2327,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/projects/columns/{column_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) + /// - 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.ProjectCard { + public var json: Components.Schemas.ProjectColumn { get throws { switch self { case let .json(body): @@ -2630,26 +2345,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body + public var body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ProjectsClassicUpdateCard.Output.Ok.Body) { + public init(body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/200`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsClassicUpdateCard.Output.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.ProjectsClassicUpdateCard.Output.Ok { + public var ok: Operations.ProjectsClassicUpdateColumn.Output.Ok { get throws { switch self { case let .ok(response): @@ -2664,13 +2379,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/304`. + /// - 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/cards/{card_id}/patch(projects-classic/update-card)/responses/304`. + /// - 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 { @@ -2695,7 +2410,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/403`. + /// - 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) @@ -2718,7 +2433,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects-classic/update-card)/responses/401`. + /// - 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) @@ -2739,52 +2454,6 @@ public enum Operations { } } } - /// 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. @@ -2816,52 +2485,52 @@ public enum Operations { } } } - /// Delete a project card + /// 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/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" + /// - 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/cards/{card_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the card. + /// The unique identifier of the column. /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path/card_id`. - public var cardId: Components.Parameters.CardId + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path/column_id`. + public var columnId: Components.Parameters.ColumnId /// Creates a new `Path`. /// /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId } } - public var path: Operations.ProjectsClassicDeleteCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/header`. + 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] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsClassicDeleteCard.Input.Headers + public var headers: Operations.ProjectsClassicDeleteColumn.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ProjectsClassicDeleteCard.Input.Path, - headers: Operations.ProjectsClassicDeleteCard.Input.Headers = .init() + path: Operations.ProjectsClassicDeleteColumn.Input.Path, + headers: Operations.ProjectsClassicDeleteColumn.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -2874,13 +2543,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/204`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsClassicDeleteCard.Output.NoContent) + case noContent(Operations.ProjectsClassicDeleteColumn.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/204`. + /// - 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 { @@ -2890,7 +2559,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsClassicDeleteCard.Output.NoContent { + public var noContent: Operations.ProjectsClassicDeleteColumn.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -2905,13 +2574,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/304`. + /// - 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/cards/{card_id}/delete(projects-classic/delete-card)/responses/304`. + /// - 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 { @@ -2934,74 +2603,17 @@ public enum Operations { } } } - 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`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/403`. /// /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsClassicDeleteCard.Output.Forbidden) + case forbidden(Components.Responses.Forbidden) /// The associated value of the enum case if `self` is `.forbidden`. /// /// - Throws: An error if `self` is not `.forbidden`. /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.ProjectsClassicDeleteCard.Output.Forbidden { + public var forbidden: Components.Responses.Forbidden { get throws { switch self { case let .forbidden(response): @@ -3016,7 +2628,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects-classic/delete-card)/responses/401`. + /// - 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) @@ -3037,1944 +2649,6 @@ public enum Operations { } } } - /// 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. From 8dac6efebed2032d377cd9b6bfc902677ae4087e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:56:53 +0000 Subject: [PATCH 06/46] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 3 ++- Sources/repos/Types.swift | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index fa57f81fb2..2eeb2872ec 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -1115,7 +1115,8 @@ public struct Client: APIProtocol { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 780a002b24..1352975e9e 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -89,7 +89,8 @@ public protocol APIProtocol: Sendable { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -2276,7 +2277,8 @@ extension APIProtocol { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -25899,7 +25901,8 @@ public enum Operations { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. From 43d3432a32992e114b40105b5e27fcf57fcf918b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:57:15 +0000 Subject: [PATCH 07/46] Commit via running: make Sources/search --- Sources/search/Client.swift | 2 +- Sources/search/Types.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index b3adc61e39..95c2694c62 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -331,7 +331,7 @@ public struct Client: APIProtocol { /// Search issues and pull requests /// /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on November 4, 2025. /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 5e9bf75b50..d3d33af1bb 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -54,7 +54,7 @@ public protocol APIProtocol: Sendable { /// Search issues and pull requests /// /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on November 4, 2025. /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. @@ -186,7 +186,7 @@ extension APIProtocol { /// Search issues and pull requests /// /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on November 4, 2025. /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. @@ -5975,7 +5975,7 @@ public enum Operations { /// Search issues and pull requests /// /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on November 4, 2025. /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. From ee46b0b469ce71d25bd67fddaffbdc545cd6f9cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Sep 2025 21:59:31 +0000 Subject: [PATCH 08/46] Commit via running: make Sources/security-advisories --- Sources/security-advisories/Types.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index d02b33642d..be06d58ef2 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -6672,7 +6672,7 @@ public enum Operations { /// If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified. /// If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. /// - /// Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` + /// Example: `affects=package1,package2@1.0.0,package3@2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` /// /// - Remark: Generated from `#/paths/advisories/GET/query/affects`. public var affects: Operations.SecurityAdvisoriesListGlobalAdvisories.Input.Query.AffectsPayload? From 38a0c19dff60c9309ed46b5be99056311a055b77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 21:08:57 +0000 Subject: [PATCH 09/46] Bump Submodule/github/rest-api-description from `f0dc156` to `b27d92b` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `f0dc156` to `b27d92b`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/f0dc156505ef3ea9ae0fd2f227aca5642c465e4f...b27d92b4094f9c4c6c60680325830982f04e5449) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: b27d92b4094f9c4c6c60680325830982f04e5449 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index f0dc156505..b27d92b409 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit f0dc156505ef3ea9ae0fd2f227aca5642c465e4f +Subproject commit b27d92b4094f9c4c6c60680325830982f04e5449 From 5a29d18a3c2342c9c2bb534c55532ec1e92f5d17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 15 Sep 2025 21:42:59 +0000 Subject: [PATCH 10/46] Commit via running: make Sources/pulls --- Sources/pulls/Types.swift | 1568 ++++++++++++++++++------------------- 1 file changed, 784 insertions(+), 784 deletions(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index dcfdba5b3b..1a700472b7 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -2939,945 +2939,945 @@ public enum Components { case ldapDn = "ldap_dn" } } - /// Metaproperties for Git author/committer information. + /// Hypermedia Link /// - /// - Remark: Generated from `#/components/schemas/nullable-git-user`. - public struct NullableGitUser: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? - /// Creates a new `NullableGitUser`. - /// - /// - Parameters: - /// - name: - /// - email: - /// - date: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - date: Swift.String? = nil - ) { - self.name = name - self.email = email - self.date = date - } - public enum CodingKeys: String, CodingKey { - case name - case email - case date - } - } - /// - Remark: Generated from `#/components/schemas/verification`. - public struct Verification: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/verification/verified`. - public var verified: Swift.Bool - /// - Remark: Generated from `#/components/schemas/verification/reason`. - public var reason: Swift.String - /// - Remark: Generated from `#/components/schemas/verification/payload`. - public var payload: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/signature`. - public var signature: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/verified_at`. - public var verifiedAt: Swift.String? - /// Creates a new `Verification`. + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. /// /// - Parameters: - /// - verified: - /// - reason: - /// - payload: - /// - signature: - /// - verifiedAt: - public init( - verified: Swift.Bool, - reason: Swift.String, - payload: Swift.String? = nil, - signature: Swift.String? = nil, - verifiedAt: Swift.String? = nil - ) { - self.verified = verified - self.reason = reason - self.payload = payload - self.signature = signature - self.verifiedAt = verifiedAt + /// - href: + public init(href: Swift.String) { + self.href = href } public enum CodingKeys: String, CodingKey { - case verified - case reason - case payload - case signature - case verifiedAt = "verified_at" + case href } } - /// Diff Entry + /// The status of auto merging a pull request. /// - /// - Remark: Generated from `#/components/schemas/diff-entry`. - public struct DiffEntry: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case added = "added" - case removed = "removed" - case modified = "modified" - case renamed = "renamed" - case copied = "copied" - case changed = "changed" - case unchanged = "unchanged" + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" } - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - public var status: Components.Schemas.DiffEntry.StatusPayload - /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. - public var additions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. - public var deletions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. - public var changes: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. - public var blobUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. - public var rawUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. - public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. - public var patch: Swift.String? - /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. - public var previousFilename: Swift.String? - /// Creates a new `DiffEntry`. + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. /// /// - Parameters: - /// - sha: - /// - filename: - /// - status: - /// - additions: - /// - deletions: - /// - changes: - /// - blobUrl: - /// - rawUrl: - /// - contentsUrl: - /// - patch: - /// - previousFilename: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. public init( - sha: Swift.String, - filename: Swift.String, - status: Components.Schemas.DiffEntry.StatusPayload, - additions: Swift.Int, - deletions: Swift.Int, - changes: Swift.Int, - blobUrl: Swift.String, - rawUrl: Swift.String, - contentsUrl: Swift.String, - patch: Swift.String? = nil, - previousFilename: Swift.String? = nil + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String ) { - self.sha = sha - self.filename = filename - self.status = status - self.additions = additions - self.deletions = deletions - self.changes = changes - self.blobUrl = blobUrl - self.rawUrl = rawUrl - self.contentsUrl = contentsUrl - self.patch = patch - self.previousFilename = previousFilename + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage } public enum CodingKeys: String, CodingKey { - case sha - case filename - case status - case additions - case deletions - case changes - case blobUrl = "blob_url" - case rawUrl = "raw_url" - case contentsUrl = "contents_url" - case patch - case previousFilename = "previous_filename" + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" } } - /// Commit + /// Pull Request Simple /// - /// - Remark: Generated from `#/components/schemas/commit`. - public struct Commit: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/node_id`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/html_url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/comments_url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/author`. - public var author: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. - public var committer: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. - public var commentCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public struct TreePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. - public var url: Swift.String - /// Creates a new `TreePayload`. - /// - /// - Parameters: - /// - sha: - /// - url: - public init( - sha: Swift.String, - url: Swift.String - ) { - self.sha = sha - self.url = url - } - public enum CodingKeys: String, CodingKey { - case sha - case url - } - } - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public var tree: Components.Schemas.Commit.CommitPayload.TreePayload - /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. - public var verification: Components.Schemas.Verification? - /// Creates a new `CommitPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. /// /// - Parameters: + /// - id: + /// - nodeId: /// - url: - /// - author: - /// - committer: - /// - message: - /// - commentCount: - /// - tree: - /// - verification: + /// - name: + /// - description: + /// - color: + /// - _default: public init( + id: Swift.Int64, + nodeId: Swift.String, url: Swift.String, - author: Components.Schemas.NullableGitUser? = nil, - committer: Components.Schemas.NullableGitUser? = nil, - message: Swift.String, - commentCount: Swift.Int, - tree: Components.Schemas.Commit.CommitPayload.TreePayload, - verification: Components.Schemas.Verification? = nil + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool ) { + self.id = id + self.nodeId = nodeId self.url = url - self.author = author - self.committer = committer - self.message = message - self.commentCount = commentCount - self.tree = tree - self.verification = verification + self.name = name + self.description = description + self.color = color + self._default = _default } public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" case url - case author - case committer - case message - case commentCount = "comment_count" - case tree - case verification - } - } - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public var commit: Components.Schemas.Commit.CommitPayload - /// - Remark: Generated from `#/components/schemas/commit/author`. - @frozen public enum AuthorPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/author/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/author/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(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 .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/components/schemas/commit/author`. - public var author: Components.Schemas.Commit.AuthorPayload? - /// - Remark: Generated from `#/components/schemas/commit/committer`. - @frozen public enum CommitterPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(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 .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } + case name + case description + case color + case _default = "default" } } - /// - Remark: Generated from `#/components/schemas/commit/committer`. - public var committer: Components.Schemas.Commit.CommitterPayload? - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. - public struct ParentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. - public var htmlUrl: Swift.String? - /// Creates a new `ParentsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. /// /// - Parameters: + /// - label: + /// - ref: + /// - repo: /// - sha: - /// - url: - /// - htmlUrl: + /// - user: public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, sha: Swift.String, - url: Swift.String, - htmlUrl: Swift.String? = nil + user: Components.Schemas.NullableSimpleUser? = nil ) { + self.label = label + self.ref = ref + self.repo = repo self.sha = sha - self.url = url - self.htmlUrl = htmlUrl + self.user = user } public enum CodingKeys: String, CodingKey { + case label + case ref + case repo case sha - case url - case htmlUrl = "html_url" + case user } } - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public var parents: Components.Schemas.Commit.ParentsPayload - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public struct StatsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. - public var additions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. - public var deletions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/total`. - public var total: Swift.Int? - /// Creates a new `StatsPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. /// /// - Parameters: - /// - additions: - /// - deletions: - /// - total: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: public init( - additions: Swift.Int? = nil, - deletions: Swift.Int? = nil, - total: Swift.Int? = nil + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link ) { - self.additions = additions - self.deletions = deletions - self.total = total + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self } public enum CodingKeys: String, CodingKey { - case additions - case deletions - case total + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" } } - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public var stats: Components.Schemas.Commit.StatsPayload? - /// - Remark: Generated from `#/components/schemas/commit/files`. - public var files: [Components.Schemas.DiffEntry]? - /// Creates a new `Commit`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. /// /// - Parameters: /// - url: - /// - sha: + /// - id: /// - nodeId: /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: /// - commentsUrl: - /// - commit: - /// - author: - /// - committer: - /// - parents: - /// - stats: - /// - files: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. public init( url: Swift.String, - sha: Swift.String, + id: Swift.Int64, nodeId: Swift.String, htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, commentsUrl: Swift.String, - commit: Components.Schemas.Commit.CommitPayload, - author: Components.Schemas.Commit.AuthorPayload? = nil, - committer: Components.Schemas.Commit.CommitterPayload? = nil, - parents: Components.Schemas.Commit.ParentsPayload, - stats: Components.Schemas.Commit.StatsPayload? = nil, - files: [Components.Schemas.DiffEntry]? = nil + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil ) { self.url = url - self.sha = sha + self.id = id self.nodeId = nodeId self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl self.commentsUrl = commentsUrl - self.commit = commit - self.author = author - self.committer = committer - self.parents = parents - self.stats = stats - self.files = files + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft + } + } + /// Metaproperties for Git author/committer information. + /// + /// - Remark: Generated from `#/components/schemas/nullable-git-user`. + public struct NullableGitUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. + public var date: Swift.String? + /// Creates a new `NullableGitUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - date: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + date: Swift.String? = nil + ) { + self.name = name + self.email = email + self.date = date } public enum CodingKeys: String, CodingKey { - case url - case sha - case nodeId = "node_id" - case htmlUrl = "html_url" - case commentsUrl = "comments_url" - case commit - case author - case committer - case parents - case stats - case files + case name + case email + case date } } - /// Hypermedia Link - /// - /// - Remark: Generated from `#/components/schemas/link`. - public struct Link: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link/href`. - public var href: Swift.String - /// Creates a new `Link`. + /// - Remark: Generated from `#/components/schemas/verification`. + public struct Verification: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/verification/verified`. + public var verified: Swift.Bool + /// - Remark: Generated from `#/components/schemas/verification/reason`. + public var reason: Swift.String + /// - Remark: Generated from `#/components/schemas/verification/payload`. + public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/signature`. + public var signature: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/verified_at`. + public var verifiedAt: Swift.String? + /// Creates a new `Verification`. /// /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href + /// - verified: + /// - reason: + /// - payload: + /// - signature: + /// - verifiedAt: + public init( + verified: Swift.Bool, + reason: Swift.String, + payload: Swift.String? = nil, + signature: Swift.String? = nil, + verifiedAt: Swift.String? = nil + ) { + self.verified = verified + self.reason = reason + self.payload = payload + self.signature = signature + self.verifiedAt = verifiedAt } public enum CodingKeys: String, CodingKey { - case href + case verified + case reason + case payload + case signature + case verifiedAt = "verified_at" } } - /// The status of auto merging a pull request. + /// Diff Entry /// - /// - Remark: Generated from `#/components/schemas/auto-merge`. - public struct AutoMerge: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. - public var enabledBy: Components.Schemas.SimpleUser - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" + /// - Remark: Generated from `#/components/schemas/diff-entry`. + public struct DiffEntry: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. + public var sha: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. + public var filename: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case added = "added" + case removed = "removed" + case modified = "modified" + case renamed = "renamed" + case copied = "copied" + case changed = "changed" + case unchanged = "unchanged" } - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload - /// Title for the merge commit message. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. - public var commitTitle: Swift.String - /// Commit message for the merge commit. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. - public var commitMessage: Swift.String - /// Creates a new `AutoMerge`. + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + public var status: Components.Schemas.DiffEntry.StatusPayload + /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. + public var additions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. + public var deletions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. + public var changes: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. + public var blobUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. + public var rawUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. + public var patch: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. + public var previousFilename: Swift.String? + /// Creates a new `DiffEntry`. /// /// - Parameters: - /// - enabledBy: - /// - mergeMethod: The merge method to use. - /// - commitTitle: Title for the merge commit message. - /// - commitMessage: Commit message for the merge commit. + /// - sha: + /// - filename: + /// - status: + /// - additions: + /// - deletions: + /// - changes: + /// - blobUrl: + /// - rawUrl: + /// - contentsUrl: + /// - patch: + /// - previousFilename: public init( - enabledBy: Components.Schemas.SimpleUser, - mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, - commitTitle: Swift.String, - commitMessage: Swift.String + sha: Swift.String? = nil, + filename: Swift.String, + status: Components.Schemas.DiffEntry.StatusPayload, + additions: Swift.Int, + deletions: Swift.Int, + changes: Swift.Int, + blobUrl: Swift.String, + rawUrl: Swift.String, + contentsUrl: Swift.String, + patch: Swift.String? = nil, + previousFilename: Swift.String? = nil ) { - self.enabledBy = enabledBy - self.mergeMethod = mergeMethod - self.commitTitle = commitTitle - self.commitMessage = commitMessage + self.sha = sha + self.filename = filename + self.status = status + self.additions = additions + self.deletions = deletions + self.changes = changes + self.blobUrl = blobUrl + self.rawUrl = rawUrl + self.contentsUrl = contentsUrl + self.patch = patch + self.previousFilename = previousFilename } public enum CodingKeys: String, CodingKey { - case enabledBy = "enabled_by" - case mergeMethod = "merge_method" - case commitTitle = "commit_title" - case commitMessage = "commit_message" + case sha + case filename + case status + case additions + case deletions + case changes + case blobUrl = "blob_url" + case rawUrl = "raw_url" + case contentsUrl = "contents_url" + case patch + case previousFilename = "previous_filename" } } - /// Pull Request Simple + /// Commit /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple`. - public struct PullRequestSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + /// - Remark: Generated from `#/components/schemas/commit`. + public struct Commit: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + /// - Remark: Generated from `#/components/schemas/commit/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. - public var diffUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. - public var patchUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. - public var reviewCommentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. - public var reviewCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + /// - Remark: Generated from `#/components/schemas/commit/comments_url`. public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. - public var locked: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. - public var description: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. - public var color: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. - public var _default: Swift.Bool - /// Creates a new `LabelsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/commit/commit/author`. + public var author: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. + public var committer: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. + public var commentCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public struct TreePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. + public var url: Swift.String + /// Creates a new `TreePayload`. + /// + /// - Parameters: + /// - sha: + /// - url: + public init( + sha: Swift.String, + url: Swift.String + ) { + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } + } + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public var tree: Components.Schemas.Commit.CommitPayload.TreePayload + /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. + public var verification: Components.Schemas.Verification? + /// Creates a new `CommitPayload`. /// /// - Parameters: - /// - id: - /// - nodeId: /// - url: - /// - name: - /// - description: - /// - color: - /// - _default: + /// - author: + /// - committer: + /// - message: + /// - commentCount: + /// - tree: + /// - verification: public init( - id: Swift.Int64, - nodeId: Swift.String, url: Swift.String, - name: Swift.String, - description: Swift.String, - color: Swift.String, - _default: Swift.Bool + author: Components.Schemas.NullableGitUser? = nil, + committer: Components.Schemas.NullableGitUser? = nil, + message: Swift.String, + commentCount: Swift.Int, + tree: Components.Schemas.Commit.CommitPayload.TreePayload, + verification: Components.Schemas.Verification? = nil ) { - self.id = id - self.nodeId = nodeId self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default + self.author = author + self.committer = committer + self.message = message + self.commentCount = commentCount + self.tree = tree + self.verification = verification } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" case url - case name - case description - case color - case _default = "default" + case author + case committer + case message + case commentCount = "comment_count" + case tree + case verification } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public var labels: Components.Schemas.PullRequestSimple.LabelsPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. - public var milestone: Components.Schemas.NullableMilestone? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. - public var activeLockReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. - public var mergedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. - public var mergeCommitSha: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. - public var assignees: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. - public var requestedReviewers: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. - public var requestedTeams: [Components.Schemas.Team]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public var commit: Components.Schemas.Commit.CommitPayload + /// - Remark: Generated from `#/components/schemas/commit/author`. + @frozen public enum AuthorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/author/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/author/case2`. + case EmptyObject(Components.Schemas.EmptyObject) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public var head: Components.Schemas.PullRequestSimple.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + /// - Remark: Generated from `#/components/schemas/commit/author`. + public var author: Components.Schemas.Commit.AuthorPayload? + /// - Remark: Generated from `#/components/schemas/commit/committer`. + @frozen public enum CommitterPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. + case EmptyObject(Components.Schemas.EmptyObject) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(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 .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/commit/committer`. + public var committer: Components.Schemas.Commit.CommitterPayload? + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. + public struct ParentsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `BasePayload`. + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `ParentsPayloadPayload`. /// /// - Parameters: - /// - label: - /// - ref: - /// - repo: /// - sha: - /// - user: + /// - url: + /// - htmlUrl: public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil + url: Swift.String, + htmlUrl: Swift.String? = nil ) { - self.label = label - self.ref = ref - self.repo = repo self.sha = sha - self.user = user + self.url = url + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { - case label - case ref - case repo case sha - case user + case url + case htmlUrl = "html_url" } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public var base: Components.Schemas.PullRequestSimple.BasePayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. - public var comments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. - public var commits: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. - public var statuses: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. - public var html: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. - public var issue: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. - public var reviewComments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. - public var reviewComment: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. - public var _self: Components.Schemas.Link - /// Creates a new `_LinksPayload`. + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public var parents: Components.Schemas.Commit.ParentsPayload + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public struct StatsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. + public var additions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. + public var deletions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/total`. + public var total: Swift.Int? + /// Creates a new `StatsPayload`. /// /// - Parameters: - /// - comments: - /// - commits: - /// - statuses: - /// - html: - /// - issue: - /// - reviewComments: - /// - reviewComment: - /// - _self: + /// - additions: + /// - deletions: + /// - total: public init( - comments: Components.Schemas.Link, - commits: Components.Schemas.Link, - statuses: Components.Schemas.Link, - html: Components.Schemas.Link, - issue: Components.Schemas.Link, - reviewComments: Components.Schemas.Link, - reviewComment: Components.Schemas.Link, - _self: Components.Schemas.Link + additions: Swift.Int? = nil, + deletions: Swift.Int? = nil, + total: Swift.Int? = nil ) { - self.comments = comments - self.commits = commits - self.statuses = statuses - self.html = html - self.issue = issue - self.reviewComments = reviewComments - self.reviewComment = reviewComment - self._self = _self + self.additions = additions + self.deletions = deletions + self.total = total } public enum CodingKeys: String, CodingKey { - case comments - case commits - case statuses - case html - case issue - case reviewComments = "review_comments" - case reviewComment = "review_comment" - case _self = "self" + case additions + case deletions + case total } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public var _links: Components.Schemas.PullRequestSimple._LinksPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. - public var autoMerge: Components.Schemas.AutoMerge? - /// Indicates whether or not the pull request is a draft. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. - public var draft: Swift.Bool? - /// Creates a new `PullRequestSimple`. + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public var stats: Components.Schemas.Commit.StatsPayload? + /// - Remark: Generated from `#/components/schemas/commit/files`. + public var files: [Components.Schemas.DiffEntry]? + /// Creates a new `Commit`. /// /// - Parameters: /// - url: - /// - id: + /// - sha: /// - nodeId: /// - htmlUrl: - /// - diffUrl: - /// - patchUrl: - /// - issueUrl: - /// - commitsUrl: - /// - reviewCommentsUrl: - /// - reviewCommentUrl: /// - commentsUrl: - /// - statusesUrl: - /// - number: - /// - state: - /// - locked: - /// - title: - /// - user: - /// - body: - /// - labels: - /// - milestone: - /// - activeLockReason: - /// - createdAt: - /// - updatedAt: - /// - closedAt: - /// - mergedAt: - /// - mergeCommitSha: - /// - assignee: - /// - assignees: - /// - requestedReviewers: - /// - requestedTeams: - /// - head: - /// - base: - /// - _links: - /// - authorAssociation: - /// - autoMerge: - /// - draft: Indicates whether or not the pull request is a draft. + /// - commit: + /// - author: + /// - committer: + /// - parents: + /// - stats: + /// - files: public init( url: Swift.String, - id: Swift.Int64, + sha: Swift.String, nodeId: Swift.String, htmlUrl: Swift.String, - diffUrl: Swift.String, - patchUrl: Swift.String, - issueUrl: Swift.String, - commitsUrl: Swift.String, - reviewCommentsUrl: Swift.String, - reviewCommentUrl: Swift.String, commentsUrl: Swift.String, - statusesUrl: Swift.String, - number: Swift.Int, - state: Swift.String, - locked: Swift.Bool, - title: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String? = nil, - labels: Components.Schemas.PullRequestSimple.LabelsPayload, - milestone: Components.Schemas.NullableMilestone? = nil, - activeLockReason: Swift.String? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - mergedAt: Foundation.Date? = nil, - mergeCommitSha: Swift.String? = nil, - assignee: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil, - requestedReviewers: [Components.Schemas.SimpleUser]? = nil, - requestedTeams: [Components.Schemas.Team]? = nil, - head: Components.Schemas.PullRequestSimple.HeadPayload, - base: Components.Schemas.PullRequestSimple.BasePayload, - _links: Components.Schemas.PullRequestSimple._LinksPayload, - authorAssociation: Components.Schemas.AuthorAssociation, - autoMerge: Components.Schemas.AutoMerge? = nil, - draft: Swift.Bool? = nil + commit: Components.Schemas.Commit.CommitPayload, + author: Components.Schemas.Commit.AuthorPayload? = nil, + committer: Components.Schemas.Commit.CommitterPayload? = nil, + parents: Components.Schemas.Commit.ParentsPayload, + stats: Components.Schemas.Commit.StatsPayload? = nil, + files: [Components.Schemas.DiffEntry]? = nil ) { self.url = url - self.id = id + self.sha = sha self.nodeId = nodeId self.htmlUrl = htmlUrl - self.diffUrl = diffUrl - self.patchUrl = patchUrl - self.issueUrl = issueUrl - self.commitsUrl = commitsUrl - self.reviewCommentsUrl = reviewCommentsUrl - self.reviewCommentUrl = reviewCommentUrl self.commentsUrl = commentsUrl - self.statusesUrl = statusesUrl - self.number = number - self.state = state - self.locked = locked - self.title = title - self.user = user - self.body = body - self.labels = labels - self.milestone = milestone - self.activeLockReason = activeLockReason - self.createdAt = createdAt - self.updatedAt = updatedAt - self.closedAt = closedAt - self.mergedAt = mergedAt - self.mergeCommitSha = mergeCommitSha - self.assignee = assignee - self.assignees = assignees - self.requestedReviewers = requestedReviewers - self.requestedTeams = requestedTeams - self.head = head - self.base = base - self._links = _links - self.authorAssociation = authorAssociation - self.autoMerge = autoMerge - self.draft = draft + self.commit = commit + self.author = author + self.committer = committer + self.parents = parents + self.stats = stats + self.files = files } public enum CodingKeys: String, CodingKey { case url - case id + case sha case nodeId = "node_id" case htmlUrl = "html_url" - case diffUrl = "diff_url" - case patchUrl = "patch_url" - case issueUrl = "issue_url" - case commitsUrl = "commits_url" - case reviewCommentsUrl = "review_comments_url" - case reviewCommentUrl = "review_comment_url" case commentsUrl = "comments_url" - case statusesUrl = "statuses_url" - case number - case state - case locked - case title - case user - case body - case labels - case milestone - case activeLockReason = "active_lock_reason" - case createdAt = "created_at" - case updatedAt = "updated_at" - case closedAt = "closed_at" - case mergedAt = "merged_at" - case mergeCommitSha = "merge_commit_sha" - case assignee - case assignees - case requestedReviewers = "requested_reviewers" - case requestedTeams = "requested_teams" - case head - case base - case _links - case authorAssociation = "author_association" - case autoMerge = "auto_merge" - case draft + case commit + case author + case committer + case parents + case stats + case files } } /// Pull Request Review Comments are comments on a portion of the Pull Request's diff. From 1412d216e20c5f3ac162befd5c1fd149a4054915 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 15 Sep 2025 21:44:07 +0000 Subject: [PATCH 11/46] Commit via running: make Sources/repos --- Sources/repos/Types.swift | 14805 ++++++++++++++++++------------------ 1 file changed, 7358 insertions(+), 7447 deletions(-) diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 1352975e9e..0d16e6b595 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -9681,3261 +9681,2627 @@ public enum Components { case parent } } - /// Custom property name and associated value + /// Hypermedia Link /// - /// - Remark: Generated from `#/components/schemas/custom-property-value`. - public struct CustomPropertyValue: Codable, Hashable, Sendable { - /// The name of the property + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. - public var propertyName: Swift.String - /// The value assigned to the property + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" } - /// The value assigned to the property + /// The merge method to use. /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - public var value: Components.Schemas.CustomPropertyValue.ValuePayload? - /// Creates a new `CustomPropertyValue`. + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. /// /// - Parameters: - /// - propertyName: The name of the property - /// - value: The value assigned to the property + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. public init( - propertyName: Swift.String, - value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String ) { - self.propertyName = propertyName - self.value = value + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage } public enum CodingKeys: String, CodingKey { - case propertyName = "property_name" - case value + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" } } - /// A repository on GitHub. + /// Pull Request Simple /// - /// - Remark: Generated from `#/components/schemas/nullable-repository`. - public struct NullableRepository: Codable, Hashable, Sendable { - /// Unique identifier of the repository - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/id`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-repository/node_id`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. public var nodeId: Swift.String - /// The name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/full_name`. - public var fullName: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/license`. - public var license: Components.Schemas.NullableLicenseSimple? - /// - Remark: Generated from `#/components/schemas/nullable-repository/forks`. - public var forks: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/admin`. - public var admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/maintain`. - public var maintain: Swift.Bool? - /// Creates a new `PermissionsPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. /// /// - Parameters: - /// - admin: - /// - pull: - /// - triage: - /// - push: - /// - maintain: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: public init( - admin: Swift.Bool, - pull: Swift.Bool, - triage: Swift.Bool? = nil, - push: Swift.Bool, - maintain: Swift.Bool? = nil + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool ) { - self.admin = admin - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default } public enum CodingKeys: String, CodingKey { - case admin - case pull - case triage - case push - case maintain + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" } } - /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions`. - public var permissions: Components.Schemas.NullableRepository.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/nullable-repository/owner`. - public var owner: Components.Schemas.SimpleUser - /// Whether the repository is private or public. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/archive_url`. - public var archiveUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/assignees_url`. - public var assigneesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/blobs_url`. - public var blobsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/branches_url`. - public var branchesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/collaborators_url`. - public var collaboratorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/compare_url`. - public var compareUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/contents_url`. - public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/contributors_url`. - public var contributorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/deployments_url`. - public var deploymentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/downloads_url`. - public var downloadsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/forks_url`. - public var forksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/git_commits_url`. - public var gitCommitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/git_refs_url`. - public var gitRefsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/git_tags_url`. - public var gitTagsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/git_url`. - public var gitUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/issue_comment_url`. - public var issueCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/issue_events_url`. - public var issueEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/issues_url`. - public var issuesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/keys_url`. - public var keysUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/labels_url`. - public var labelsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/languages_url`. - public var languagesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/merges_url`. - public var mergesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/milestones_url`. - public var milestonesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/notifications_url`. - public var notificationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/pulls_url`. - public var pullsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/releases_url`. - public var releasesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/ssh_url`. - public var sshUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/stargazers_url`. - public var stargazersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/subscribers_url`. - public var subscribersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/subscription_url`. - public var subscriptionUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/tags_url`. - public var tagsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/teams_url`. - public var teamsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/trees_url`. - public var treesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/clone_url`. - public var cloneUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/mirror_url`. - public var mirrorUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/hooks_url`. - public var hooksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/svn_url`. - public var svnUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/homepage`. - public var homepage: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/language`. - public var language: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/forks_count`. - public var forksCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-repository/stargazers_count`. - public var stargazersCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-repository/watchers_count`. - public var watchersCount: Swift.Int - /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/size`. - public var size: Swift.Int - /// The default branch of the repository. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/default_branch`. - public var defaultBranch: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-repository/open_issues_count`. - public var openIssuesCount: Swift.Int - /// Whether this repository acts as a template that can be used to generate new repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/is_template`. - public var isTemplate: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-repository/topics`. - public var topics: [Swift.String]? - /// Whether issues are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_issues`. - public var hasIssues: Swift.Bool - /// Whether projects are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_projects`. - public var hasProjects: Swift.Bool - /// Whether the wiki is enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_wiki`. - public var hasWiki: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_pages`. - public var hasPages: Swift.Bool - /// Whether downloads are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_downloads`. - @available(*, deprecated) - public var hasDownloads: Swift.Bool - /// Whether discussions are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_discussions`. - public var hasDiscussions: Swift.Bool? - /// Whether the repository is archived. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. - public var archived: Swift.Bool - /// Returns whether or not this repository disabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/disabled`. - public var disabled: Swift.Bool - /// The repository visibility: public, private, or internal. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/visibility`. - public var visibility: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/pushed_at`. - public var pushedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/nullable-repository/created_at`. - public var createdAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/nullable-repository/updated_at`. - public var updatedAt: Foundation.Date? - /// Whether to allow rebase merges for pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_rebase_merge`. - public var allowRebaseMerge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-repository/temp_clone_token`. - public var tempCloneToken: Swift.String? - /// Whether to allow squash merges for pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_squash_merge`. - public var allowSquashMerge: Swift.Bool? - /// Whether to allow Auto-merge to be used on pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_auto_merge`. - public var allowAutoMerge: Swift.Bool? - /// Whether to delete head branches when pull requests are merged - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/delete_branch_on_merge`. - public var deleteBranchOnMerge: Swift.Bool? - /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_update_branch`. - public var allowUpdateBranch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/use_squash_pr_title_as_default`. - @available(*, deprecated) - public var useSquashPrTitleAsDefault: Swift.Bool? - /// The default value for a squash merge commit title: - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_title`. - @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prTitle = "PR_TITLE" - case commitOrPrTitle = "COMMIT_OR_PR_TITLE" - } - /// The default value for a squash merge commit title: - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_title`. - public var squashMergeCommitTitle: Components.Schemas.NullableRepository.SquashMergeCommitTitlePayload? - /// The default value for a squash merge commit message: - /// - /// - `PR_BODY` - default to the pull request's body. - /// - `COMMIT_MESSAGES` - default to the branch's commit messages. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_message`. - @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prBody = "PR_BODY" - case commitMessages = "COMMIT_MESSAGES" - case blank = "BLANK" - } - /// The default value for a squash merge commit message: - /// - /// - `PR_BODY` - default to the pull request's body. - /// - `COMMIT_MESSAGES` - default to the branch's commit messages. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_message`. - public var squashMergeCommitMessage: Components.Schemas.NullableRepository.SquashMergeCommitMessagePayload? - /// The default value for a merge commit title. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_title`. - @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prTitle = "PR_TITLE" - case mergeMessage = "MERGE_MESSAGE" - } - /// The default value for a merge commit title. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_title`. - public var mergeCommitTitle: Components.Schemas.NullableRepository.MergeCommitTitlePayload? - /// The default value for a merge commit message. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `PR_BODY` - default to the pull request's body. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_message`. - @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prBody = "PR_BODY" - case prTitle = "PR_TITLE" - case blank = "BLANK" - } - /// The default value for a merge commit message. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `PR_BODY` - default to the pull request's body. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_message`. - public var mergeCommitMessage: Components.Schemas.NullableRepository.MergeCommitMessagePayload? - /// Whether to allow merge commits for pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_merge_commit`. - public var allowMergeCommit: Swift.Bool? - /// Whether to allow forking this repo - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_forking`. - public var allowForking: Swift.Bool? - /// Whether to require contributors to sign off on web-based commits - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/web_commit_signoff_required`. - public var webCommitSignoffRequired: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-repository/open_issues`. - public var openIssues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-repository/watchers`. - public var watchers: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-repository/master_branch`. - public var masterBranch: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-repository/starred_at`. - public var starredAt: Swift.String? - /// Whether anonymous git access is enabled for this repository - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/anonymous_access_enabled`. - public var anonymousAccessEnabled: Swift.Bool? - /// The status of the code search index for this repository - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. - public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_search_ok`. - public var lexicalSearchOk: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_commit_sha`. - public var lexicalCommitSha: Swift.String? - /// Creates a new `CodeSearchIndexStatusPayload`. - /// - /// - Parameters: - /// - lexicalSearchOk: - /// - lexicalCommitSha: - public init( - lexicalSearchOk: Swift.Bool? = nil, - lexicalCommitSha: Swift.String? = nil - ) { - self.lexicalSearchOk = lexicalSearchOk - self.lexicalCommitSha = lexicalCommitSha - } - public enum CodingKeys: String, CodingKey { - case lexicalSearchOk = "lexical_search_ok" - case lexicalCommitSha = "lexical_commit_sha" - } - } - /// The status of the code search index for this repository - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. - public var codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? - /// Creates a new `NullableRepository`. - /// - /// - Parameters: - /// - id: Unique identifier of the repository - /// - nodeId: - /// - name: The name of the repository. - /// - fullName: - /// - license: - /// - forks: - /// - permissions: - /// - owner: - /// - _private: Whether the repository is private or public. - /// - htmlUrl: - /// - description: - /// - fork: - /// - url: - /// - archiveUrl: - /// - assigneesUrl: - /// - blobsUrl: - /// - branchesUrl: - /// - collaboratorsUrl: - /// - commentsUrl: - /// - commitsUrl: - /// - compareUrl: - /// - contentsUrl: - /// - contributorsUrl: - /// - deploymentsUrl: - /// - downloadsUrl: - /// - eventsUrl: - /// - forksUrl: - /// - gitCommitsUrl: - /// - gitRefsUrl: - /// - gitTagsUrl: - /// - gitUrl: - /// - issueCommentUrl: - /// - issueEventsUrl: - /// - issuesUrl: - /// - keysUrl: - /// - labelsUrl: - /// - languagesUrl: - /// - mergesUrl: - /// - milestonesUrl: - /// - notificationsUrl: - /// - pullsUrl: - /// - releasesUrl: - /// - sshUrl: - /// - stargazersUrl: - /// - statusesUrl: - /// - subscribersUrl: - /// - subscriptionUrl: - /// - tagsUrl: - /// - teamsUrl: - /// - treesUrl: - /// - cloneUrl: - /// - mirrorUrl: - /// - hooksUrl: - /// - svnUrl: - /// - homepage: - /// - language: - /// - forksCount: - /// - stargazersCount: - /// - watchersCount: - /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - defaultBranch: The default branch of the repository. - /// - openIssuesCount: - /// - isTemplate: Whether this repository acts as a template that can be used to generate new repositories. - /// - topics: - /// - hasIssues: Whether issues are enabled. - /// - hasProjects: Whether projects are enabled. - /// - hasWiki: Whether the wiki is enabled. - /// - hasPages: - /// - hasDownloads: Whether downloads are enabled. - /// - hasDiscussions: Whether discussions are enabled. - /// - archived: Whether the repository is archived. - /// - disabled: Returns whether or not this repository disabled. - /// - visibility: The repository visibility: public, private, or internal. - /// - pushedAt: - /// - createdAt: - /// - updatedAt: - /// - allowRebaseMerge: Whether to allow rebase merges for pull requests. - /// - tempCloneToken: - /// - allowSquashMerge: Whether to allow squash merges for pull requests. - /// - allowAutoMerge: Whether to allow Auto-merge to be used on pull requests. - /// - deleteBranchOnMerge: Whether to delete head branches when pull requests are merged - /// - allowUpdateBranch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - useSquashPrTitleAsDefault: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. - /// - squashMergeCommitTitle: The default value for a squash merge commit title: - /// - squashMergeCommitMessage: The default value for a squash merge commit message: - /// - mergeCommitTitle: The default value for a merge commit title. - /// - mergeCommitMessage: The default value for a merge commit message. - /// - allowMergeCommit: Whether to allow merge commits for pull requests. - /// - allowForking: Whether to allow forking this repo - /// - webCommitSignoffRequired: Whether to require contributors to sign off on web-based commits - /// - openIssues: - /// - watchers: - /// - masterBranch: - /// - starredAt: - /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository - /// - codeSearchIndexStatus: The status of the code search index for this repository - public init( - id: Swift.Int64, - nodeId: Swift.String, - name: Swift.String, - fullName: Swift.String, - license: Components.Schemas.NullableLicenseSimple? = nil, - forks: Swift.Int, - permissions: Components.Schemas.NullableRepository.PermissionsPayload? = nil, - owner: Components.Schemas.SimpleUser, - _private: Swift.Bool, - htmlUrl: Swift.String, - description: Swift.String? = nil, - fork: Swift.Bool, - url: Swift.String, - archiveUrl: Swift.String, - assigneesUrl: Swift.String, - blobsUrl: Swift.String, - branchesUrl: Swift.String, - collaboratorsUrl: Swift.String, - commentsUrl: Swift.String, - commitsUrl: Swift.String, - compareUrl: Swift.String, - contentsUrl: Swift.String, - contributorsUrl: Swift.String, - deploymentsUrl: Swift.String, - downloadsUrl: Swift.String, - eventsUrl: Swift.String, - forksUrl: Swift.String, - gitCommitsUrl: Swift.String, - gitRefsUrl: Swift.String, - gitTagsUrl: Swift.String, - gitUrl: Swift.String, - issueCommentUrl: Swift.String, - issueEventsUrl: Swift.String, - issuesUrl: Swift.String, - keysUrl: Swift.String, - labelsUrl: Swift.String, - languagesUrl: Swift.String, - mergesUrl: Swift.String, - milestonesUrl: Swift.String, - notificationsUrl: Swift.String, - pullsUrl: Swift.String, - releasesUrl: Swift.String, - sshUrl: Swift.String, - stargazersUrl: Swift.String, - statusesUrl: Swift.String, - subscribersUrl: Swift.String, - subscriptionUrl: Swift.String, - tagsUrl: Swift.String, - teamsUrl: Swift.String, - treesUrl: Swift.String, - cloneUrl: Swift.String, - mirrorUrl: Swift.String? = nil, - hooksUrl: Swift.String, - svnUrl: Swift.String, - homepage: Swift.String? = nil, - language: Swift.String? = nil, - forksCount: Swift.Int, - stargazersCount: Swift.Int, - watchersCount: Swift.Int, - size: Swift.Int, - defaultBranch: Swift.String, - openIssuesCount: Swift.Int, - isTemplate: Swift.Bool? = nil, - topics: [Swift.String]? = nil, - hasIssues: Swift.Bool, - hasProjects: Swift.Bool, - hasWiki: Swift.Bool, - hasPages: Swift.Bool, - hasDownloads: Swift.Bool, - hasDiscussions: Swift.Bool? = nil, - archived: Swift.Bool, - disabled: Swift.Bool, - visibility: Swift.String? = nil, - pushedAt: Foundation.Date? = nil, - createdAt: Foundation.Date? = nil, - updatedAt: Foundation.Date? = nil, - allowRebaseMerge: Swift.Bool? = nil, - tempCloneToken: Swift.String? = nil, - allowSquashMerge: Swift.Bool? = nil, - allowAutoMerge: Swift.Bool? = nil, - deleteBranchOnMerge: Swift.Bool? = nil, - allowUpdateBranch: Swift.Bool? = nil, - useSquashPrTitleAsDefault: Swift.Bool? = nil, - squashMergeCommitTitle: Components.Schemas.NullableRepository.SquashMergeCommitTitlePayload? = nil, - squashMergeCommitMessage: Components.Schemas.NullableRepository.SquashMergeCommitMessagePayload? = nil, - mergeCommitTitle: Components.Schemas.NullableRepository.MergeCommitTitlePayload? = nil, - mergeCommitMessage: Components.Schemas.NullableRepository.MergeCommitMessagePayload? = nil, - allowMergeCommit: Swift.Bool? = nil, - allowForking: Swift.Bool? = nil, - webCommitSignoffRequired: Swift.Bool? = nil, - openIssues: Swift.Int, - watchers: Swift.Int, - masterBranch: Swift.String? = nil, - starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil, - codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? = nil - ) { - self.id = id - self.nodeId = nodeId - self.name = name - self.fullName = fullName - self.license = license - self.forks = forks - self.permissions = permissions - self.owner = owner - self._private = _private - self.htmlUrl = htmlUrl - self.description = description - self.fork = fork - self.url = url - self.archiveUrl = archiveUrl - self.assigneesUrl = assigneesUrl - self.blobsUrl = blobsUrl - self.branchesUrl = branchesUrl - self.collaboratorsUrl = collaboratorsUrl - self.commentsUrl = commentsUrl - self.commitsUrl = commitsUrl - self.compareUrl = compareUrl - self.contentsUrl = contentsUrl - self.contributorsUrl = contributorsUrl - self.deploymentsUrl = deploymentsUrl - self.downloadsUrl = downloadsUrl - self.eventsUrl = eventsUrl - self.forksUrl = forksUrl - self.gitCommitsUrl = gitCommitsUrl - self.gitRefsUrl = gitRefsUrl - self.gitTagsUrl = gitTagsUrl - self.gitUrl = gitUrl - self.issueCommentUrl = issueCommentUrl - self.issueEventsUrl = issueEventsUrl - self.issuesUrl = issuesUrl - self.keysUrl = keysUrl - self.labelsUrl = labelsUrl - self.languagesUrl = languagesUrl - self.mergesUrl = mergesUrl - self.milestonesUrl = milestonesUrl - self.notificationsUrl = notificationsUrl - self.pullsUrl = pullsUrl - self.releasesUrl = releasesUrl - self.sshUrl = sshUrl - self.stargazersUrl = stargazersUrl - self.statusesUrl = statusesUrl - self.subscribersUrl = subscribersUrl - self.subscriptionUrl = subscriptionUrl - self.tagsUrl = tagsUrl - self.teamsUrl = teamsUrl - self.treesUrl = treesUrl - self.cloneUrl = cloneUrl - self.mirrorUrl = mirrorUrl - self.hooksUrl = hooksUrl - self.svnUrl = svnUrl - self.homepage = homepage - self.language = language - self.forksCount = forksCount - self.stargazersCount = stargazersCount - self.watchersCount = watchersCount - self.size = size - self.defaultBranch = defaultBranch - self.openIssuesCount = openIssuesCount - self.isTemplate = isTemplate - self.topics = topics - self.hasIssues = hasIssues - self.hasProjects = hasProjects - self.hasWiki = hasWiki - self.hasPages = hasPages - self.hasDownloads = hasDownloads - self.hasDiscussions = hasDiscussions - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.pushedAt = pushedAt - self.createdAt = createdAt - self.updatedAt = updatedAt - self.allowRebaseMerge = allowRebaseMerge - self.tempCloneToken = tempCloneToken - self.allowSquashMerge = allowSquashMerge - self.allowAutoMerge = allowAutoMerge - self.deleteBranchOnMerge = deleteBranchOnMerge - self.allowUpdateBranch = allowUpdateBranch - self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault - self.squashMergeCommitTitle = squashMergeCommitTitle - self.squashMergeCommitMessage = squashMergeCommitMessage - self.mergeCommitTitle = mergeCommitTitle - self.mergeCommitMessage = mergeCommitMessage - self.allowMergeCommit = allowMergeCommit - self.allowForking = allowForking - self.webCommitSignoffRequired = webCommitSignoffRequired - self.openIssues = openIssues - self.watchers = watchers - self.masterBranch = masterBranch - self.starredAt = starredAt - self.anonymousAccessEnabled = anonymousAccessEnabled - self.codeSearchIndexStatus = codeSearchIndexStatus - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case name - case fullName = "full_name" - case license - case forks - case permissions - case owner - case _private = "private" - case htmlUrl = "html_url" - case description - case fork - case url - case archiveUrl = "archive_url" - case assigneesUrl = "assignees_url" - case blobsUrl = "blobs_url" - case branchesUrl = "branches_url" - case collaboratorsUrl = "collaborators_url" - case commentsUrl = "comments_url" - case commitsUrl = "commits_url" - case compareUrl = "compare_url" - case contentsUrl = "contents_url" - case contributorsUrl = "contributors_url" - case deploymentsUrl = "deployments_url" - case downloadsUrl = "downloads_url" - case eventsUrl = "events_url" - case forksUrl = "forks_url" - case gitCommitsUrl = "git_commits_url" - case gitRefsUrl = "git_refs_url" - case gitTagsUrl = "git_tags_url" - case gitUrl = "git_url" - case issueCommentUrl = "issue_comment_url" - case issueEventsUrl = "issue_events_url" - case issuesUrl = "issues_url" - case keysUrl = "keys_url" - case labelsUrl = "labels_url" - case languagesUrl = "languages_url" - case mergesUrl = "merges_url" - case milestonesUrl = "milestones_url" - case notificationsUrl = "notifications_url" - case pullsUrl = "pulls_url" - case releasesUrl = "releases_url" - case sshUrl = "ssh_url" - case stargazersUrl = "stargazers_url" - case statusesUrl = "statuses_url" - case subscribersUrl = "subscribers_url" - case subscriptionUrl = "subscription_url" - case tagsUrl = "tags_url" - case teamsUrl = "teams_url" - case treesUrl = "trees_url" - case cloneUrl = "clone_url" - case mirrorUrl = "mirror_url" - case hooksUrl = "hooks_url" - case svnUrl = "svn_url" - case homepage - case language - case forksCount = "forks_count" - case stargazersCount = "stargazers_count" - case watchersCount = "watchers_count" - case size - case defaultBranch = "default_branch" - case openIssuesCount = "open_issues_count" - case isTemplate = "is_template" - case topics - case hasIssues = "has_issues" - case hasProjects = "has_projects" - case hasWiki = "has_wiki" - case hasPages = "has_pages" - case hasDownloads = "has_downloads" - case hasDiscussions = "has_discussions" - case archived - case disabled - case visibility - case pushedAt = "pushed_at" - case createdAt = "created_at" - case updatedAt = "updated_at" - case allowRebaseMerge = "allow_rebase_merge" - case tempCloneToken = "temp_clone_token" - case allowSquashMerge = "allow_squash_merge" - case allowAutoMerge = "allow_auto_merge" - case deleteBranchOnMerge = "delete_branch_on_merge" - case allowUpdateBranch = "allow_update_branch" - case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" - case squashMergeCommitTitle = "squash_merge_commit_title" - case squashMergeCommitMessage = "squash_merge_commit_message" - case mergeCommitTitle = "merge_commit_title" - case mergeCommitMessage = "merge_commit_message" - case allowMergeCommit = "allow_merge_commit" - case allowForking = "allow_forking" - case webCommitSignoffRequired = "web_commit_signoff_required" - case openIssues = "open_issues" - case watchers - case masterBranch = "master_branch" - case starredAt = "starred_at" - case anonymousAccessEnabled = "anonymous_access_enabled" - case codeSearchIndexStatus = "code_search_index_status" - } - } - /// Code of Conduct Simple - /// - /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple`. - public struct CodeOfConductSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/key`. - public var key: Swift.String - /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/html_url`. - public var htmlUrl: Swift.String? - /// Creates a new `CodeOfConductSimple`. - /// - /// - Parameters: - /// - url: - /// - key: - /// - name: - /// - htmlUrl: - public init( - url: Swift.String, - key: Swift.String, - name: Swift.String, - htmlUrl: Swift.String? = nil - ) { - self.url = url - self.key = key - self.name = name - self.htmlUrl = htmlUrl - } - public enum CodingKeys: String, CodingKey { - case url - case key - case name - case htmlUrl = "html_url" - } - } - /// Full Repository - /// - /// - Remark: Generated from `#/components/schemas/full-repository`. - public struct FullRepository: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/full-repository/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/full-repository/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/full_name`. - public var fullName: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/owner`. - public var owner: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/full-repository/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/archive_url`. - public var archiveUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/assignees_url`. - public var assigneesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/blobs_url`. - public var blobsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/branches_url`. - public var branchesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/collaborators_url`. - public var collaboratorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/compare_url`. - public var compareUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/contents_url`. - public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/contributors_url`. - public var contributorsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/deployments_url`. - public var deploymentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/downloads_url`. - public var downloadsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/forks_url`. - public var forksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/git_commits_url`. - public var gitCommitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/git_refs_url`. - public var gitRefsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/git_tags_url`. - public var gitTagsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/git_url`. - public var gitUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/issue_comment_url`. - public var issueCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/issue_events_url`. - public var issueEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/issues_url`. - public var issuesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/keys_url`. - public var keysUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/labels_url`. - public var labelsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/languages_url`. - public var languagesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/merges_url`. - public var mergesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/milestones_url`. - public var milestonesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/notifications_url`. - public var notificationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/pulls_url`. - public var pullsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/releases_url`. - public var releasesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/ssh_url`. - public var sshUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/stargazers_url`. - public var stargazersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/subscribers_url`. - public var subscribersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/subscription_url`. - public var subscriptionUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/tags_url`. - public var tagsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/teams_url`. - public var teamsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/trees_url`. - public var treesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/clone_url`. - public var cloneUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/mirror_url`. - public var mirrorUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/hooks_url`. - public var hooksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/svn_url`. - public var svnUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/homepage`. - public var homepage: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/language`. - public var language: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/forks_count`. - public var forksCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/stargazers_count`. - public var stargazersCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/watchers_count`. - public var watchersCount: Swift.Int - /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/size`. - public var size: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/default_branch`. - public var defaultBranch: Swift.String - /// - Remark: Generated from `#/components/schemas/full-repository/open_issues_count`. - public var openIssuesCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/is_template`. - public var isTemplate: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/topics`. - public var topics: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/full-repository/has_issues`. - public var hasIssues: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/has_projects`. - public var hasProjects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/has_wiki`. - public var hasWiki: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/has_pages`. - public var hasPages: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/has_downloads`. - public var hasDownloads: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/has_discussions`. - public var hasDiscussions: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/archived`. - public var archived: Swift.Bool - /// Returns whether or not this repository disabled. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/disabled`. - public var disabled: Swift.Bool - /// The repository visibility: public, private, or internal. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/visibility`. - public var visibility: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/pushed_at`. - public var pushedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/full-repository/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/full-repository/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/full-repository/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/full-repository/permissions/admin`. - public var admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/full-repository/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/permissions/pull`. - public var pull: Swift.Bool - /// Creates a new `PermissionsPayload`. - /// - /// - Parameters: - /// - admin: - /// - maintain: - /// - push: - /// - triage: - /// - pull: - public init( - admin: Swift.Bool, - maintain: Swift.Bool? = nil, - push: Swift.Bool, - triage: Swift.Bool? = nil, - pull: Swift.Bool - ) { - self.admin = admin - self.maintain = maintain - self.push = push - self.triage = triage - self.pull = pull - } - public enum CodingKeys: String, CodingKey { - case admin - case maintain - case push - case triage - case pull - } - } - /// - Remark: Generated from `#/components/schemas/full-repository/permissions`. - public var permissions: Components.Schemas.FullRepository.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_rebase_merge`. - public var allowRebaseMerge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/template_repository`. - public var templateRepository: Components.Schemas.NullableRepository? - /// - Remark: Generated from `#/components/schemas/full-repository/temp_clone_token`. - public var tempCloneToken: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_squash_merge`. - public var allowSquashMerge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_auto_merge`. - public var allowAutoMerge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/delete_branch_on_merge`. - public var deleteBranchOnMerge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_merge_commit`. - public var allowMergeCommit: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_update_branch`. - public var allowUpdateBranch: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/use_squash_pr_title_as_default`. - public var useSquashPrTitleAsDefault: Swift.Bool? - /// The default value for a squash merge commit title: - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). - /// - /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_title`. - @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prTitle = "PR_TITLE" - case commitOrPrTitle = "COMMIT_OR_PR_TITLE" - } - /// The default value for a squash merge commit title: - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). - /// - /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_title`. - public var squashMergeCommitTitle: Components.Schemas.FullRepository.SquashMergeCommitTitlePayload? - /// The default value for a squash merge commit message: - /// - /// - `PR_BODY` - default to the pull request's body. - /// - `COMMIT_MESSAGES` - default to the branch's commit messages. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_message`. - @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prBody = "PR_BODY" - case commitMessages = "COMMIT_MESSAGES" - case blank = "BLANK" - } - /// The default value for a squash merge commit message: - /// - /// - `PR_BODY` - default to the pull request's body. - /// - `COMMIT_MESSAGES` - default to the branch's commit messages. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_message`. - public var squashMergeCommitMessage: Components.Schemas.FullRepository.SquashMergeCommitMessagePayload? - /// The default value for a merge commit title. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). - /// - /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_title`. - @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prTitle = "PR_TITLE" - case mergeMessage = "MERGE_MESSAGE" - } - /// The default value for a merge commit title. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). - /// - /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_title`. - public var mergeCommitTitle: Components.Schemas.FullRepository.MergeCommitTitlePayload? - /// The default value for a merge commit message. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `PR_BODY` - default to the pull request's body. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_message`. - @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { - case prBody = "PR_BODY" - case prTitle = "PR_TITLE" - case blank = "BLANK" - } - /// The default value for a merge commit message. - /// - /// - `PR_TITLE` - default to the pull request's title. - /// - `PR_BODY` - default to the pull request's body. - /// - `BLANK` - default to a blank commit message. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_message`. - public var mergeCommitMessage: Components.Schemas.FullRepository.MergeCommitMessagePayload? - /// - Remark: Generated from `#/components/schemas/full-repository/allow_forking`. - public var allowForking: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/web_commit_signoff_required`. - public var webCommitSignoffRequired: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/subscribers_count`. - public var subscribersCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/network_count`. - public var networkCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/license`. - public var license: Components.Schemas.NullableLicenseSimple? - /// - Remark: Generated from `#/components/schemas/full-repository/organization`. - public var organization: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/full-repository/parent`. - public var parent: Components.Schemas.Repository? - /// - Remark: Generated from `#/components/schemas/full-repository/source`. - public var source: Components.Schemas.Repository? - /// - Remark: Generated from `#/components/schemas/full-repository/forks`. - public var forks: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/master_branch`. - public var masterBranch: Swift.String? - /// - Remark: Generated from `#/components/schemas/full-repository/open_issues`. - public var openIssues: Swift.Int - /// - Remark: Generated from `#/components/schemas/full-repository/watchers`. - public var watchers: Swift.Int - /// Whether anonymous git access is allowed. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/anonymous_access_enabled`. - public var anonymousAccessEnabled: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/full-repository/code_of_conduct`. - public var codeOfConduct: Components.Schemas.CodeOfConductSimple? - /// - Remark: Generated from `#/components/schemas/full-repository/security_and_analysis`. - public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? - /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/custom_properties`. - public struct CustomPropertiesPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CustomPropertiesPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. - /// - /// - Remark: Generated from `#/components/schemas/full-repository/custom_properties`. - public var customProperties: Components.Schemas.FullRepository.CustomPropertiesPayload? - /// Creates a new `FullRepository`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - name: - /// - fullName: - /// - owner: - /// - _private: - /// - htmlUrl: - /// - description: - /// - fork: - /// - url: - /// - archiveUrl: - /// - assigneesUrl: - /// - blobsUrl: - /// - branchesUrl: - /// - collaboratorsUrl: - /// - commentsUrl: - /// - commitsUrl: - /// - compareUrl: - /// - contentsUrl: - /// - contributorsUrl: - /// - deploymentsUrl: - /// - downloadsUrl: - /// - eventsUrl: - /// - forksUrl: - /// - gitCommitsUrl: - /// - gitRefsUrl: - /// - gitTagsUrl: - /// - gitUrl: - /// - issueCommentUrl: - /// - issueEventsUrl: - /// - issuesUrl: - /// - keysUrl: - /// - labelsUrl: - /// - languagesUrl: - /// - mergesUrl: - /// - milestonesUrl: - /// - notificationsUrl: - /// - pullsUrl: - /// - releasesUrl: - /// - sshUrl: - /// - stargazersUrl: - /// - statusesUrl: - /// - subscribersUrl: - /// - subscriptionUrl: - /// - tagsUrl: - /// - teamsUrl: - /// - treesUrl: - /// - cloneUrl: - /// - mirrorUrl: - /// - hooksUrl: - /// - svnUrl: - /// - homepage: - /// - language: - /// - forksCount: - /// - stargazersCount: - /// - watchersCount: - /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. - /// - defaultBranch: - /// - openIssuesCount: - /// - isTemplate: - /// - topics: - /// - hasIssues: - /// - hasProjects: - /// - hasWiki: - /// - hasPages: - /// - hasDownloads: - /// - hasDiscussions: - /// - archived: - /// - disabled: Returns whether or not this repository disabled. - /// - visibility: The repository visibility: public, private, or internal. - /// - pushedAt: - /// - createdAt: - /// - updatedAt: - /// - permissions: - /// - allowRebaseMerge: - /// - templateRepository: - /// - tempCloneToken: - /// - allowSquashMerge: - /// - allowAutoMerge: - /// - deleteBranchOnMerge: - /// - allowMergeCommit: - /// - allowUpdateBranch: - /// - useSquashPrTitleAsDefault: - /// - squashMergeCommitTitle: The default value for a squash merge commit title: - /// - squashMergeCommitMessage: The default value for a squash merge commit message: - /// - mergeCommitTitle: The default value for a merge commit title. - /// - mergeCommitMessage: The default value for a merge commit message. - /// - allowForking: - /// - webCommitSignoffRequired: - /// - subscribersCount: - /// - networkCount: - /// - license: - /// - organization: - /// - parent: - /// - source: - /// - forks: - /// - masterBranch: - /// - openIssues: - /// - watchers: - /// - anonymousAccessEnabled: Whether anonymous git access is allowed. - /// - codeOfConduct: - /// - securityAndAnalysis: - /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. - public init( - id: Swift.Int64, - nodeId: Swift.String, - name: Swift.String, - fullName: Swift.String, - owner: Components.Schemas.SimpleUser, - _private: Swift.Bool, - htmlUrl: Swift.String, - description: Swift.String? = nil, - fork: Swift.Bool, - url: Swift.String, - archiveUrl: Swift.String, - assigneesUrl: Swift.String, - blobsUrl: Swift.String, - branchesUrl: Swift.String, - collaboratorsUrl: Swift.String, - commentsUrl: Swift.String, - commitsUrl: Swift.String, - compareUrl: Swift.String, - contentsUrl: Swift.String, - contributorsUrl: Swift.String, - deploymentsUrl: Swift.String, - downloadsUrl: Swift.String, - eventsUrl: Swift.String, - forksUrl: Swift.String, - gitCommitsUrl: Swift.String, - gitRefsUrl: Swift.String, - gitTagsUrl: Swift.String, - gitUrl: Swift.String, - issueCommentUrl: Swift.String, - issueEventsUrl: Swift.String, - issuesUrl: Swift.String, - keysUrl: Swift.String, - labelsUrl: Swift.String, - languagesUrl: Swift.String, - mergesUrl: Swift.String, - milestonesUrl: Swift.String, - notificationsUrl: Swift.String, - pullsUrl: Swift.String, - releasesUrl: Swift.String, - sshUrl: Swift.String, - stargazersUrl: Swift.String, - statusesUrl: Swift.String, - subscribersUrl: Swift.String, - subscriptionUrl: Swift.String, - tagsUrl: Swift.String, - teamsUrl: Swift.String, - treesUrl: Swift.String, - cloneUrl: Swift.String, - mirrorUrl: Swift.String? = nil, - hooksUrl: Swift.String, - svnUrl: Swift.String, - homepage: Swift.String? = nil, - language: Swift.String? = nil, - forksCount: Swift.Int, - stargazersCount: Swift.Int, - watchersCount: Swift.Int, - size: Swift.Int, - defaultBranch: Swift.String, - openIssuesCount: Swift.Int, - isTemplate: Swift.Bool? = nil, - topics: [Swift.String]? = nil, - hasIssues: Swift.Bool, - hasProjects: Swift.Bool, - hasWiki: Swift.Bool, - hasPages: Swift.Bool, - hasDownloads: Swift.Bool? = nil, - hasDiscussions: Swift.Bool, - archived: Swift.Bool, - disabled: Swift.Bool, - visibility: Swift.String? = nil, - pushedAt: Foundation.Date, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - permissions: Components.Schemas.FullRepository.PermissionsPayload? = nil, - allowRebaseMerge: Swift.Bool? = nil, - templateRepository: Components.Schemas.NullableRepository? = nil, - tempCloneToken: Swift.String? = nil, - allowSquashMerge: Swift.Bool? = nil, - allowAutoMerge: Swift.Bool? = nil, - deleteBranchOnMerge: Swift.Bool? = nil, - allowMergeCommit: Swift.Bool? = nil, - allowUpdateBranch: Swift.Bool? = nil, - useSquashPrTitleAsDefault: Swift.Bool? = nil, - squashMergeCommitTitle: Components.Schemas.FullRepository.SquashMergeCommitTitlePayload? = nil, - squashMergeCommitMessage: Components.Schemas.FullRepository.SquashMergeCommitMessagePayload? = nil, - mergeCommitTitle: Components.Schemas.FullRepository.MergeCommitTitlePayload? = nil, - mergeCommitMessage: Components.Schemas.FullRepository.MergeCommitMessagePayload? = nil, - allowForking: Swift.Bool? = nil, - webCommitSignoffRequired: Swift.Bool? = nil, - subscribersCount: Swift.Int, - networkCount: Swift.Int, - license: Components.Schemas.NullableLicenseSimple? = nil, - organization: Components.Schemas.NullableSimpleUser? = nil, - parent: Components.Schemas.Repository? = nil, - source: Components.Schemas.Repository? = nil, - forks: Swift.Int, - masterBranch: Swift.String? = nil, - openIssues: Swift.Int, - watchers: Swift.Int, - anonymousAccessEnabled: Swift.Bool? = nil, - codeOfConduct: Components.Schemas.CodeOfConductSimple? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, - customProperties: Components.Schemas.FullRepository.CustomPropertiesPayload? = nil - ) { - self.id = id - self.nodeId = nodeId - self.name = name - self.fullName = fullName - self.owner = owner - self._private = _private - self.htmlUrl = htmlUrl - self.description = description - self.fork = fork - self.url = url - self.archiveUrl = archiveUrl - self.assigneesUrl = assigneesUrl - self.blobsUrl = blobsUrl - self.branchesUrl = branchesUrl - self.collaboratorsUrl = collaboratorsUrl - self.commentsUrl = commentsUrl - self.commitsUrl = commitsUrl - self.compareUrl = compareUrl - self.contentsUrl = contentsUrl - self.contributorsUrl = contributorsUrl - self.deploymentsUrl = deploymentsUrl - self.downloadsUrl = downloadsUrl - self.eventsUrl = eventsUrl - self.forksUrl = forksUrl - self.gitCommitsUrl = gitCommitsUrl - self.gitRefsUrl = gitRefsUrl - self.gitTagsUrl = gitTagsUrl - self.gitUrl = gitUrl - self.issueCommentUrl = issueCommentUrl - self.issueEventsUrl = issueEventsUrl - self.issuesUrl = issuesUrl - self.keysUrl = keysUrl - self.labelsUrl = labelsUrl - self.languagesUrl = languagesUrl - self.mergesUrl = mergesUrl - self.milestonesUrl = milestonesUrl - self.notificationsUrl = notificationsUrl - self.pullsUrl = pullsUrl - self.releasesUrl = releasesUrl - self.sshUrl = sshUrl - self.stargazersUrl = stargazersUrl - self.statusesUrl = statusesUrl - self.subscribersUrl = subscribersUrl - self.subscriptionUrl = subscriptionUrl - self.tagsUrl = tagsUrl - self.teamsUrl = teamsUrl - self.treesUrl = treesUrl - self.cloneUrl = cloneUrl - self.mirrorUrl = mirrorUrl - self.hooksUrl = hooksUrl - self.svnUrl = svnUrl - self.homepage = homepage - self.language = language - self.forksCount = forksCount - self.stargazersCount = stargazersCount - self.watchersCount = watchersCount - self.size = size - self.defaultBranch = defaultBranch - self.openIssuesCount = openIssuesCount - self.isTemplate = isTemplate - self.topics = topics - self.hasIssues = hasIssues - self.hasProjects = hasProjects - self.hasWiki = hasWiki - self.hasPages = hasPages - self.hasDownloads = hasDownloads - self.hasDiscussions = hasDiscussions - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.pushedAt = pushedAt - self.createdAt = createdAt - self.updatedAt = updatedAt - self.permissions = permissions - self.allowRebaseMerge = allowRebaseMerge - self.templateRepository = templateRepository - self.tempCloneToken = tempCloneToken - self.allowSquashMerge = allowSquashMerge - self.allowAutoMerge = allowAutoMerge - self.deleteBranchOnMerge = deleteBranchOnMerge - self.allowMergeCommit = allowMergeCommit - self.allowUpdateBranch = allowUpdateBranch - self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault - self.squashMergeCommitTitle = squashMergeCommitTitle - self.squashMergeCommitMessage = squashMergeCommitMessage - self.mergeCommitTitle = mergeCommitTitle - self.mergeCommitMessage = mergeCommitMessage - self.allowForking = allowForking - self.webCommitSignoffRequired = webCommitSignoffRequired - self.subscribersCount = subscribersCount - self.networkCount = networkCount - self.license = license - self.organization = organization - self.parent = parent - self.source = source - self.forks = forks - self.masterBranch = masterBranch - self.openIssues = openIssues - self.watchers = watchers - self.anonymousAccessEnabled = anonymousAccessEnabled - self.codeOfConduct = codeOfConduct - self.securityAndAnalysis = securityAndAnalysis - self.customProperties = customProperties - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case name - case fullName = "full_name" - case owner - case _private = "private" - case htmlUrl = "html_url" - case description - case fork - case url - case archiveUrl = "archive_url" - case assigneesUrl = "assignees_url" - case blobsUrl = "blobs_url" - case branchesUrl = "branches_url" - case collaboratorsUrl = "collaborators_url" - case commentsUrl = "comments_url" - case commitsUrl = "commits_url" - case compareUrl = "compare_url" - case contentsUrl = "contents_url" - case contributorsUrl = "contributors_url" - case deploymentsUrl = "deployments_url" - case downloadsUrl = "downloads_url" - case eventsUrl = "events_url" - case forksUrl = "forks_url" - case gitCommitsUrl = "git_commits_url" - case gitRefsUrl = "git_refs_url" - case gitTagsUrl = "git_tags_url" - case gitUrl = "git_url" - case issueCommentUrl = "issue_comment_url" - case issueEventsUrl = "issue_events_url" - case issuesUrl = "issues_url" - case keysUrl = "keys_url" - case labelsUrl = "labels_url" - case languagesUrl = "languages_url" - case mergesUrl = "merges_url" - case milestonesUrl = "milestones_url" - case notificationsUrl = "notifications_url" - case pullsUrl = "pulls_url" - case releasesUrl = "releases_url" - case sshUrl = "ssh_url" - case stargazersUrl = "stargazers_url" - case statusesUrl = "statuses_url" - case subscribersUrl = "subscribers_url" - case subscriptionUrl = "subscription_url" - case tagsUrl = "tags_url" - case teamsUrl = "teams_url" - case treesUrl = "trees_url" - case cloneUrl = "clone_url" - case mirrorUrl = "mirror_url" - case hooksUrl = "hooks_url" - case svnUrl = "svn_url" - case homepage - case language - case forksCount = "forks_count" - case stargazersCount = "stargazers_count" - case watchersCount = "watchers_count" - case size - case defaultBranch = "default_branch" - case openIssuesCount = "open_issues_count" - case isTemplate = "is_template" - case topics - case hasIssues = "has_issues" - case hasProjects = "has_projects" - case hasWiki = "has_wiki" - case hasPages = "has_pages" - case hasDownloads = "has_downloads" - case hasDiscussions = "has_discussions" - case archived - case disabled - case visibility - case pushedAt = "pushed_at" - case createdAt = "created_at" - case updatedAt = "updated_at" - case permissions - case allowRebaseMerge = "allow_rebase_merge" - case templateRepository = "template_repository" - case tempCloneToken = "temp_clone_token" - case allowSquashMerge = "allow_squash_merge" - case allowAutoMerge = "allow_auto_merge" - case deleteBranchOnMerge = "delete_branch_on_merge" - case allowMergeCommit = "allow_merge_commit" - case allowUpdateBranch = "allow_update_branch" - case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" - case squashMergeCommitTitle = "squash_merge_commit_title" - case squashMergeCommitMessage = "squash_merge_commit_message" - case mergeCommitTitle = "merge_commit_title" - case mergeCommitMessage = "merge_commit_message" - case allowForking = "allow_forking" - case webCommitSignoffRequired = "web_commit_signoff_required" - case subscribersCount = "subscribers_count" - case networkCount = "network_count" - case license - case organization - case parent - case source - case forks - case masterBranch = "master_branch" - case openIssues = "open_issues" - case watchers - case anonymousAccessEnabled = "anonymous_access_enabled" - case codeOfConduct = "code_of_conduct" - case securityAndAnalysis = "security_and_analysis" - case customProperties = "custom_properties" - } - } - /// The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-enforcement`. - @frozen public enum RepositoryRuleEnforcement: String, Codable, Hashable, Sendable, CaseIterable { - case disabled = "disabled" - case active = "active" - case evaluate = "evaluate" - } - /// An actor that can bypass rules in a ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor`. - public struct RepositoryRulesetBypassActor: Codable, Hashable, Sendable { - /// The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_id`. - public var actorId: Swift.Int? - /// The type of actor that can bypass a ruleset. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. - @frozen public enum ActorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case integration = "Integration" - case organizationAdmin = "OrganizationAdmin" - case repositoryRole = "RepositoryRole" - case team = "Team" - case deployKey = "DeployKey" - } - /// The type of actor that can bypass a ruleset. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. - public var actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. - @frozen public enum BypassModePayload: String, Codable, Hashable, Sendable, CaseIterable { - case always = "always" - case pullRequest = "pull_request" - } - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. - public var bypassMode: Components.Schemas.RepositoryRulesetBypassActor.BypassModePayload? - /// Creates a new `RepositoryRulesetBypassActor`. - /// - /// - Parameters: - /// - actorId: The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. - /// - actorType: The type of actor that can bypass a ruleset. - /// - bypassMode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. - public init( - actorId: Swift.Int? = nil, - actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload, - bypassMode: Components.Schemas.RepositoryRulesetBypassActor.BypassModePayload? = nil - ) { - self.actorId = actorId - self.actorType = actorType - self.bypassMode = bypassMode - } - public enum CodingKeys: String, CodingKey { - case actorId = "actor_id" - case actorType = "actor_type" - case bypassMode = "bypass_mode" - } - } - /// Parameters for a repository ruleset ref name condition - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions`. - public struct RepositoryRulesetConditions: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name`. - public struct RefNamePayload: Codable, Hashable, Sendable { - /// Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name/include`. - public var include: [Swift.String]? - /// Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name/exclude`. - public var exclude: [Swift.String]? - /// Creates a new `RefNamePayload`. - /// - /// - Parameters: - /// - include: Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. - /// - exclude: Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. - public init( - include: [Swift.String]? = nil, - exclude: [Swift.String]? = nil - ) { - self.include = include - self.exclude = exclude - } - public enum CodingKeys: String, CodingKey { - case include - case exclude - } - } - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name`. - public var refName: Components.Schemas.RepositoryRulesetConditions.RefNamePayload? - /// Creates a new `RepositoryRulesetConditions`. - /// - /// - Parameters: - /// - refName: - public init(refName: Components.Schemas.RepositoryRulesetConditions.RefNamePayload? = nil) { - self.refName = refName - } - public enum CodingKeys: String, CodingKey { - case refName = "ref_name" - } - } - /// Parameters for a repository name condition - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target`. - public struct RepositoryRulesetConditionsRepositoryNameTarget: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name`. - public struct RepositoryNamePayload: Codable, Hashable, Sendable { - /// Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/include`. - public var include: [Swift.String]? - /// Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/exclude`. - public var exclude: [Swift.String]? - /// Whether renaming of target repositories is prevented. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/protected`. - public var protected: Swift.Bool? - /// Creates a new `RepositoryNamePayload`. - /// - /// - Parameters: - /// - include: Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories. - /// - exclude: Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. - /// - protected: Whether renaming of target repositories is prevented. - public init( - include: [Swift.String]? = nil, - exclude: [Swift.String]? = nil, - protected: Swift.Bool? = nil - ) { - self.include = include - self.exclude = exclude - self.protected = protected - } - public enum CodingKeys: String, CodingKey { - case include - case exclude - case protected - } - } - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name`. - public var repositoryName: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget.RepositoryNamePayload - /// Creates a new `RepositoryRulesetConditionsRepositoryNameTarget`. - /// - /// - Parameters: - /// - repositoryName: - public init(repositoryName: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget.RepositoryNamePayload) { - self.repositoryName = repositoryName - } - public enum CodingKeys: String, CodingKey { - case repositoryName = "repository_name" - } - } - /// Parameters for a repository ID condition - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target`. - public struct RepositoryRulesetConditionsRepositoryIdTarget: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id`. - public struct RepositoryIdPayload: Codable, Hashable, Sendable { - /// The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id/repository_ids`. - public var repositoryIds: [Swift.Int]? - /// Creates a new `RepositoryIdPayload`. - /// - /// - Parameters: - /// - repositoryIds: The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. - public init(repositoryIds: [Swift.Int]? = nil) { - self.repositoryIds = repositoryIds - } - public enum CodingKeys: String, CodingKey { - case repositoryIds = "repository_ids" - } - } - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id`. - public var repositoryId: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget.RepositoryIdPayload - /// Creates a new `RepositoryRulesetConditionsRepositoryIdTarget`. - /// - /// - Parameters: - /// - repositoryId: - public init(repositoryId: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget.RepositoryIdPayload) { - self.repositoryId = repositoryId - } - public enum CodingKeys: String, CodingKey { - case repositoryId = "repository_id" - } - } - /// Parameters for a targeting a repository property - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec`. - public struct RepositoryRulesetConditionsRepositoryPropertySpec: Codable, Hashable, Sendable { - /// The name of the repository property to target - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/name`. - public var name: Swift.String - /// The values to match for the repository property - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/property_values`. - public var propertyValues: [Swift.String] - /// The source of the repository property. Defaults to 'custom' if not specified. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/source`. - @frozen public enum SourcePayload: String, Codable, Hashable, Sendable, CaseIterable { - case custom = "custom" - case system = "system" - } - /// The source of the repository property. Defaults to 'custom' if not specified. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/source`. - public var source: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec.SourcePayload? - /// Creates a new `RepositoryRulesetConditionsRepositoryPropertySpec`. - /// - /// - Parameters: - /// - name: The name of the repository property to target - /// - propertyValues: The values to match for the repository property - /// - source: The source of the repository property. Defaults to 'custom' if not specified. - public init( - name: Swift.String, - propertyValues: [Swift.String], - source: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec.SourcePayload? = nil - ) { - self.name = name - self.propertyValues = propertyValues - self.source = source - } - public enum CodingKeys: String, CodingKey { - case name - case propertyValues = "property_values" - case source - } - } - /// Parameters for a repository property condition - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target`. - public struct RepositoryRulesetConditionsRepositoryPropertyTarget: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. - public struct RepositoryPropertyPayload: Codable, Hashable, Sendable { - /// The repository properties and values to include. All of these properties must match for the condition to pass. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/include`. - public var include: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? - /// The repository properties and values to exclude. The condition will not pass if any of these properties match. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/exclude`. - public var exclude: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? - /// Creates a new `RepositoryPropertyPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. /// /// - Parameters: - /// - include: The repository properties and values to include. All of these properties must match for the condition to pass. - /// - exclude: The repository properties and values to exclude. The condition will not pass if any of these properties match. + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: public init( - include: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? = nil, - exclude: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? = nil + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil ) { - self.include = include - self.exclude = exclude + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user } public enum CodingKeys: String, CodingKey { - case include - case exclude - } - } - /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. - public var repositoryProperty: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget.RepositoryPropertyPayload - /// Creates a new `RepositoryRulesetConditionsRepositoryPropertyTarget`. - /// - /// - Parameters: - /// - repositoryProperty: - public init(repositoryProperty: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget.RepositoryPropertyPayload) { - self.repositoryProperty = repositoryProperty - } - public enum CodingKeys: String, CodingKey { - case repositoryProperty = "repository_property" - } - } - /// Conditions for an organization ruleset. - /// The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties. - /// The push rulesets conditions object does not require the `ref_name` property. - /// For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions`. - @frozen public enum OrgRulesetConditions: Codable, Hashable, Sendable { - /// Conditions to target repositories by name and refs by name - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1/value1`. - public var value1: Components.Schemas.RepositoryRulesetConditions - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1/value2`. - public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - value1: - /// - value2: - public init( - value1: Components.Schemas.RepositoryRulesetConditions, - value2: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget - ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - self.value1 = try .init(from: decoder) - self.value2 = try .init(from: decoder) - } - public func encode(to encoder: any Encoder) throws { - try self.value1.encode(to: encoder) - try self.value2.encode(to: encoder) + case label + case ref + case repo + case sha + case user } } - /// Conditions to target repositories by name and refs by name - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1`. - case case1(Components.Schemas.OrgRulesetConditions.Case1Payload) - /// Conditions to target repositories by id and refs by name - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2/value1`. - public var value1: Components.Schemas.RepositoryRulesetConditions - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2/value2`. - public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget - /// Creates a new `Case2Payload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. /// /// - Parameters: - /// - value1: - /// - value2: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: public init( - value1: Components.Schemas.RepositoryRulesetConditions, - value2: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - self.value1 = try .init(from: decoder) - self.value2 = try .init(from: decoder) + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user } - public func encode(to encoder: any Encoder) throws { - try self.value1.encode(to: encoder) - try self.value2.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user } } - /// Conditions to target repositories by id and refs by name - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2`. - case case2(Components.Schemas.OrgRulesetConditions.Case2Payload) - /// Conditions to target repositories by property and refs by name - /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. - public struct Case3Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value1`. - public var value1: Components.Schemas.RepositoryRulesetConditions - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value2`. - public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget - /// Creates a new `Case3Payload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. /// /// - Parameters: - /// - value1: - /// - value2: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: public init( - value1: Components.Schemas.RepositoryRulesetConditions, - value2: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - self.value1 = try .init(from: decoder) - self.value2 = try .init(from: decoder) + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self } - public func encode(to encoder: any Encoder) throws { - try self.value1.encode(to: encoder) - try self.value2.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" } } - /// Conditions to target repositories by property and refs by name + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. /// - /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. - case case3(Components.Schemas.OrgRulesetConditions.Case3Payload) - 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) - } - do { - self = .case3(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. + /// + /// - Parameters: + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft } - public 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) - case let .case3(value): - try value.encode(to: encoder) - } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft } } - /// Only allow users with bypass permission to create matching refs. + /// Custom property name and associated value /// - /// - Remark: Generated from `#/components/schemas/repository-rule-creation`. - public struct RepositoryRuleCreation: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-creation/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case creation = "creation" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-creation/type`. - public var _type: Components.Schemas.RepositoryRuleCreation._TypePayload - /// Creates a new `RepositoryRuleCreation`. + /// - Remark: Generated from `#/components/schemas/custom-property-value`. + public struct CustomPropertyValue: Codable, Hashable, Sendable { + /// The name of the property /// - /// - Parameters: - /// - _type: - public init(_type: Components.Schemas.RepositoryRuleCreation._TypePayload) { - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - } - } - /// Only allow users with bypass permission to update matching refs. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-update`. - public struct RepositoryRuleUpdate: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-update/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case update = "update" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-update/type`. - public var _type: Components.Schemas.RepositoryRuleUpdate._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// Branch can pull changes from its upstream repository - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters/update_allows_fetch_and_merge`. - public var updateAllowsFetchAndMerge: Swift.Bool - /// Creates a new `ParametersPayload`. - /// - /// - Parameters: - /// - updateAllowsFetchAndMerge: Branch can pull changes from its upstream repository - public init(updateAllowsFetchAndMerge: Swift.Bool) { - self.updateAllowsFetchAndMerge = updateAllowsFetchAndMerge + /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. + public var propertyName: Swift.String + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case updateAllowsFetchAndMerge = "update_allows_fetch_and_merge" + 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) + } } } - /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters`. - public var parameters: Components.Schemas.RepositoryRuleUpdate.ParametersPayload? - /// Creates a new `RepositoryRuleUpdate`. + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + public var value: Components.Schemas.CustomPropertyValue.ValuePayload? + /// Creates a new `CustomPropertyValue`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - propertyName: The name of the property + /// - value: The value assigned to the property public init( - _type: Components.Schemas.RepositoryRuleUpdate._TypePayload, - parameters: Components.Schemas.RepositoryRuleUpdate.ParametersPayload? = nil + propertyName: Swift.String, + value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil ) { - self._type = _type - self.parameters = parameters + self.propertyName = propertyName + self.value = value } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case propertyName = "property_name" + case value } } - /// Only allow users with bypass permissions to delete matching refs. + /// A repository on GitHub. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-deletion`. - public struct RepositoryRuleDeletion: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-deletion/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case deletion = "deletion" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-deletion/type`. - public var _type: Components.Schemas.RepositoryRuleDeletion._TypePayload - /// Creates a new `RepositoryRuleDeletion`. + /// - Remark: Generated from `#/components/schemas/nullable-repository`. + public struct NullableRepository: Codable, Hashable, Sendable { + /// Unique identifier of the repository /// - /// - Parameters: - /// - _type: - public init(_type: Components.Schemas.RepositoryRuleDeletion._TypePayload) { - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - } - } - /// Prevent merge commits from being pushed to matching refs. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history`. - public struct RepositoryRuleRequiredLinearHistory: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case requiredLinearHistory = "required_linear_history" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history/type`. - public var _type: Components.Schemas.RepositoryRuleRequiredLinearHistory._TypePayload - /// Creates a new `RepositoryRuleRequiredLinearHistory`. + /// - Remark: Generated from `#/components/schemas/nullable-repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-repository/node_id`. + public var nodeId: Swift.String + /// The name of the repository. /// - /// - Parameters: - /// - _type: - public init(_type: Components.Schemas.RepositoryRuleRequiredLinearHistory._TypePayload) { - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - } - } - /// Merges must be performed via a merge queue. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue`. - public struct RepositoryRuleMergeQueue: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case mergeQueue = "merge_queue" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/type`. - public var _type: Components.Schemas.RepositoryRuleMergeQueue._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/check_response_timeout_minutes`. - public var checkResponseTimeoutMinutes: Swift.Int - /// When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/grouping_strategy`. - @frozen public enum GroupingStrategyPayload: String, Codable, Hashable, Sendable, CaseIterable { - case allgreen = "ALLGREEN" - case headgreen = "HEADGREEN" - } - /// When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/grouping_strategy`. - public var groupingStrategy: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.GroupingStrategyPayload - /// Limit the number of queued pull requests requesting checks and workflow runs at the same time. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/max_entries_to_build`. - public var maxEntriesToBuild: Swift.Int - /// The maximum number of PRs that will be merged together in a group. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/max_entries_to_merge`. - public var maxEntriesToMerge: Swift.Int - /// Method to use when merging changes from queued pull requests. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "MERGE" - case squash = "SQUASH" - case rebase = "REBASE" - } - /// Method to use when merging changes from queued pull requests. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/merge_method`. - public var mergeMethod: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.MergeMethodPayload - /// The minimum number of PRs that will be merged together in a group. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/min_entries_to_merge`. - public var minEntriesToMerge: Swift.Int - /// The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/min_entries_to_merge_wait_minutes`. - public var minEntriesToMergeWaitMinutes: Swift.Int - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/nullable-repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/nullable-repository/forks`. + public var forks: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/admin`. + public var admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - checkResponseTimeoutMinutes: Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed - /// - groupingStrategy: When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. - /// - maxEntriesToBuild: Limit the number of queued pull requests requesting checks and workflow runs at the same time. - /// - maxEntriesToMerge: The maximum number of PRs that will be merged together in a group. - /// - mergeMethod: Method to use when merging changes from queued pull requests. - /// - minEntriesToMerge: The minimum number of PRs that will be merged together in a group. - /// - minEntriesToMergeWaitMinutes: The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. + /// - admin: + /// - pull: + /// - triage: + /// - push: + /// - maintain: public init( - checkResponseTimeoutMinutes: Swift.Int, - groupingStrategy: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.GroupingStrategyPayload, - maxEntriesToBuild: Swift.Int, - maxEntriesToMerge: Swift.Int, - mergeMethod: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.MergeMethodPayload, - minEntriesToMerge: Swift.Int, - minEntriesToMergeWaitMinutes: Swift.Int + admin: Swift.Bool, + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil ) { - self.checkResponseTimeoutMinutes = checkResponseTimeoutMinutes - self.groupingStrategy = groupingStrategy - self.maxEntriesToBuild = maxEntriesToBuild - self.maxEntriesToMerge = maxEntriesToMerge - self.mergeMethod = mergeMethod - self.minEntriesToMerge = minEntriesToMerge - self.minEntriesToMergeWaitMinutes = minEntriesToMergeWaitMinutes + self.admin = admin + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain } public enum CodingKeys: String, CodingKey { - case checkResponseTimeoutMinutes = "check_response_timeout_minutes" - case groupingStrategy = "grouping_strategy" - case maxEntriesToBuild = "max_entries_to_build" - case maxEntriesToMerge = "max_entries_to_merge" - case mergeMethod = "merge_method" - case minEntriesToMerge = "min_entries_to_merge" - case minEntriesToMergeWaitMinutes = "min_entries_to_merge_wait_minutes" + case admin + case pull + case triage + case push + case maintain } } - /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters`. - public var parameters: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload? - /// Creates a new `RepositoryRuleMergeQueue`. + /// - Remark: Generated from `#/components/schemas/nullable-repository/permissions`. + public var permissions: Components.Schemas.NullableRepository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/nullable-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private or public. /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleMergeQueue._TypePayload, - parameters: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - Remark: Generated from `#/components/schemas/nullable-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/git_url`. + public var gitUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/ssh_url`. + public var sshUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/clone_url`. + public var cloneUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/svn_url`. + public var svnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/forks_count`. + public var forksCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-repository/stargazers_count`. + public var stargazersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-repository/watchers_count`. + public var watchersCount: Swift.Int + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/size`. + public var size: Swift.Int + /// The default branch of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/default_branch`. + public var defaultBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-repository/open_issues_count`. + public var openIssuesCount: Swift.Int + /// Whether this repository acts as a template that can be used to generate new repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/topics`. + public var topics: [Swift.String]? + /// Whether issues are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_issues`. + public var hasIssues: Swift.Bool + /// Whether projects are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_projects`. + public var hasProjects: Swift.Bool + /// Whether the wiki is enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_wiki`. + public var hasWiki: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_pages`. + public var hasPages: Swift.Bool + /// Whether downloads are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_downloads`. + @available(*, deprecated) + public var hasDownloads: Swift.Bool + /// Whether discussions are enabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// Whether the repository is archived. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. + public var archived: Swift.Bool + /// Returns whether or not this repository disabled. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/disabled`. + public var disabled: Swift.Bool + /// The repository visibility: public, private, or internal. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-repository/updated_at`. + public var updatedAt: Foundation.Date? + /// Whether to allow rebase merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_rebase_merge`. + public var allowRebaseMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// Whether to allow squash merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_squash_merge`. + public var allowSquashMerge: Swift.Bool? + /// Whether to allow Auto-merge to be used on pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_auto_merge`. + public var allowAutoMerge: Swift.Bool? + /// Whether to delete head branches when pull requests are merged + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_update_branch`. + public var allowUpdateBranch: Swift.Bool? + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/use_squash_pr_title_as_default`. + @available(*, deprecated) + public var useSquashPrTitleAsDefault: Swift.Bool? + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_title`. + @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case commitOrPrTitle = "COMMIT_OR_PR_TITLE" + } + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_title`. + public var squashMergeCommitTitle: Components.Schemas.NullableRepository.SquashMergeCommitTitlePayload? + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_message`. + @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case commitMessages = "COMMIT_MESSAGES" + case blank = "BLANK" } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/squash_merge_commit_message`. + public var squashMergeCommitMessage: Components.Schemas.NullableRepository.SquashMergeCommitMessagePayload? + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_title`. + @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case mergeMessage = "MERGE_MESSAGE" } - } - /// Choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments`. - public struct RepositoryRuleRequiredDeployments: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case requiredDeployments = "required_deployments" + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_title`. + public var mergeCommitTitle: Components.Schemas.NullableRepository.MergeCommitTitlePayload? + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_message`. + @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case prTitle = "PR_TITLE" + case blank = "BLANK" } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/type`. - public var _type: Components.Schemas.RepositoryRuleRequiredDeployments._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// The environments that must be successfully deployed to before branches can be merged. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters/required_deployment_environments`. - public var requiredDeploymentEnvironments: [Swift.String] - /// Creates a new `ParametersPayload`. + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/merge_commit_message`. + public var mergeCommitMessage: Components.Schemas.NullableRepository.MergeCommitMessagePayload? + /// Whether to allow merge commits for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_merge_commit`. + public var allowMergeCommit: Swift.Bool? + /// Whether to allow forking this repo + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_forking`. + public var allowForking: Swift.Bool? + /// Whether to require contributors to sign off on web-based commits + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-repository/watchers`. + public var watchers: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-repository/master_branch`. + public var masterBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-repository/starred_at`. + public var starredAt: Swift.String? + /// Whether anonymous git access is enabled for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/anonymous_access_enabled`. + public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. /// /// - Parameters: - /// - requiredDeploymentEnvironments: The environments that must be successfully deployed to before branches can be merged. - public init(requiredDeploymentEnvironments: [Swift.String]) { - self.requiredDeploymentEnvironments = requiredDeploymentEnvironments + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha } public enum CodingKeys: String, CodingKey { - case requiredDeploymentEnvironments = "required_deployment_environments" + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" } } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters`. - public var parameters: Components.Schemas.RepositoryRuleRequiredDeployments.ParametersPayload? - /// Creates a new `RepositoryRuleRequiredDeployments`. + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? + /// Creates a new `NullableRepository`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - id: Unique identifier of the repository + /// - nodeId: + /// - name: The name of the repository. + /// - fullName: + /// - license: + /// - forks: + /// - permissions: + /// - owner: + /// - _private: Whether the repository is private or public. + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: The default branch of the repository. + /// - openIssuesCount: + /// - isTemplate: Whether this repository acts as a template that can be used to generate new repositories. + /// - topics: + /// - hasIssues: Whether issues are enabled. + /// - hasProjects: Whether projects are enabled. + /// - hasWiki: Whether the wiki is enabled. + /// - hasPages: + /// - hasDownloads: Whether downloads are enabled. + /// - hasDiscussions: Whether discussions are enabled. + /// - archived: Whether the repository is archived. + /// - disabled: Returns whether or not this repository disabled. + /// - visibility: The repository visibility: public, private, or internal. + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - allowRebaseMerge: Whether to allow rebase merges for pull requests. + /// - tempCloneToken: + /// - allowSquashMerge: Whether to allow squash merges for pull requests. + /// - allowAutoMerge: Whether to allow Auto-merge to be used on pull requests. + /// - deleteBranchOnMerge: Whether to delete head branches when pull requests are merged + /// - allowUpdateBranch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// - useSquashPrTitleAsDefault: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// - squashMergeCommitTitle: The default value for a squash merge commit title: + /// - squashMergeCommitMessage: The default value for a squash merge commit message: + /// - mergeCommitTitle: The default value for a merge commit title. + /// - mergeCommitMessage: The default value for a merge commit message. + /// - allowMergeCommit: Whether to allow merge commits for pull requests. + /// - allowForking: Whether to allow forking this repo + /// - webCommitSignoffRequired: Whether to require contributors to sign off on web-based commits + /// - openIssues: + /// - watchers: + /// - masterBranch: + /// - starredAt: + /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( - _type: Components.Schemas.RepositoryRuleRequiredDeployments._TypePayload, - parameters: Components.Schemas.RepositoryRuleRequiredDeployments.ParametersPayload? = nil + id: Swift.Int64, + nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + license: Components.Schemas.NullableLicenseSimple? = nil, + forks: Swift.Int, + permissions: Components.Schemas.NullableRepository.PermissionsPayload? = nil, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int, + stargazersCount: Swift.Int, + watchersCount: Swift.Int, + size: Swift.Int, + defaultBranch: Swift.String, + openIssuesCount: Swift.Int, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool, + hasProjects: Swift.Bool, + hasWiki: Swift.Bool, + hasPages: Swift.Bool, + hasDownloads: Swift.Bool, + hasDiscussions: Swift.Bool? = nil, + archived: Swift.Bool, + disabled: Swift.Bool, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + allowRebaseMerge: Swift.Bool? = nil, + tempCloneToken: Swift.String? = nil, + allowSquashMerge: Swift.Bool? = nil, + allowAutoMerge: Swift.Bool? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + allowUpdateBranch: Swift.Bool? = nil, + useSquashPrTitleAsDefault: Swift.Bool? = nil, + squashMergeCommitTitle: Components.Schemas.NullableRepository.SquashMergeCommitTitlePayload? = nil, + squashMergeCommitMessage: Components.Schemas.NullableRepository.SquashMergeCommitMessagePayload? = nil, + mergeCommitTitle: Components.Schemas.NullableRepository.MergeCommitTitlePayload? = nil, + mergeCommitMessage: Components.Schemas.NullableRepository.MergeCommitMessagePayload? = nil, + allowMergeCommit: Swift.Bool? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + openIssues: Swift.Int, + watchers: Swift.Int, + masterBranch: Swift.String? = nil, + starredAt: Swift.String? = nil, + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? = nil ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// Commits pushed to matching refs must have verified signatures. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures`. - public struct RepositoryRuleRequiredSignatures: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case requiredSignatures = "required_signatures" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures/type`. - public var _type: Components.Schemas.RepositoryRuleRequiredSignatures._TypePayload - /// Creates a new `RepositoryRuleRequiredSignatures`. - /// - /// - Parameters: - /// - _type: - public init(_type: Components.Schemas.RepositoryRuleRequiredSignatures._TypePayload) { - self._type = _type + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.license = license + self.forks = forks + self.permissions = permissions + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.allowRebaseMerge = allowRebaseMerge + self.tempCloneToken = tempCloneToken + self.allowSquashMerge = allowSquashMerge + self.allowAutoMerge = allowAutoMerge + self.deleteBranchOnMerge = deleteBranchOnMerge + self.allowUpdateBranch = allowUpdateBranch + self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault + self.squashMergeCommitTitle = squashMergeCommitTitle + self.squashMergeCommitMessage = squashMergeCommitMessage + self.mergeCommitTitle = mergeCommitTitle + self.mergeCommitMessage = mergeCommitMessage + self.allowMergeCommit = allowMergeCommit + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.openIssues = openIssues + self.watchers = watchers + self.masterBranch = masterBranch + self.starredAt = starredAt + self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { - case _type = "type" + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case license + case forks + case permissions + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case allowRebaseMerge = "allow_rebase_merge" + case tempCloneToken = "temp_clone_token" + case allowSquashMerge = "allow_squash_merge" + case allowAutoMerge = "allow_auto_merge" + case deleteBranchOnMerge = "delete_branch_on_merge" + case allowUpdateBranch = "allow_update_branch" + case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" + case squashMergeCommitTitle = "squash_merge_commit_title" + case squashMergeCommitMessage = "squash_merge_commit_message" + case mergeCommitTitle = "merge_commit_title" + case mergeCommitMessage = "merge_commit_message" + case allowMergeCommit = "allow_merge_commit" + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case openIssues = "open_issues" + case watchers + case masterBranch = "master_branch" + case starredAt = "starred_at" + case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } - /// Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. + /// Code of Conduct Simple /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request`. - public struct RepositoryRulePullRequest: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case pullRequest = "pull_request" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/type`. - public var _type: Components.Schemas.RepositoryRulePullRequest._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/AllowedMergeMethodsPayload`. - @frozen public enum AllowedMergeMethodsPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" - } - /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. - public typealias AllowedMergeMethodsPayload = [Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayloadPayload] - /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. - public var allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? - /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. - public var automaticCopilotCodeReviewEnabled: Swift.Bool? - /// New, reviewable commits pushed will dismiss previous pull request review approvals. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismiss_stale_reviews_on_push`. - public var dismissStaleReviewsOnPush: Swift.Bool - /// Require an approving review in pull requests that modify files that have a designated code owner. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/require_code_owner_review`. - public var requireCodeOwnerReview: Swift.Bool - /// Whether the most recent reviewable push must be approved by someone other than the person who pushed it. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/require_last_push_approval`. - public var requireLastPushApproval: Swift.Bool - /// The number of approving reviews that are required before a pull request can be merged. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_approving_review_count`. - public var requiredApprovingReviewCount: Swift.Int - /// All conversations on code must be resolved before a pull request can be merged. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_review_thread_resolution`. - public var requiredReviewThreadResolution: Swift.Bool - /// Creates a new `ParametersPayload`. - /// - /// - Parameters: - /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - automaticCopilotCodeReviewEnabled: Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. - /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. - /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. - /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. - /// - requiredApprovingReviewCount: The number of approving reviews that are required before a pull request can be merged. - /// - requiredReviewThreadResolution: All conversations on code must be resolved before a pull request can be merged. - public init( - allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? = nil, - automaticCopilotCodeReviewEnabled: Swift.Bool? = nil, - dismissStaleReviewsOnPush: Swift.Bool, - requireCodeOwnerReview: Swift.Bool, - requireLastPushApproval: Swift.Bool, - requiredApprovingReviewCount: Swift.Int, - requiredReviewThreadResolution: Swift.Bool - ) { - self.allowedMergeMethods = allowedMergeMethods - self.automaticCopilotCodeReviewEnabled = automaticCopilotCodeReviewEnabled - self.dismissStaleReviewsOnPush = dismissStaleReviewsOnPush - self.requireCodeOwnerReview = requireCodeOwnerReview - self.requireLastPushApproval = requireLastPushApproval - self.requiredApprovingReviewCount = requiredApprovingReviewCount - self.requiredReviewThreadResolution = requiredReviewThreadResolution - } - public enum CodingKeys: String, CodingKey { - case allowedMergeMethods = "allowed_merge_methods" - case automaticCopilotCodeReviewEnabled = "automatic_copilot_code_review_enabled" - case dismissStaleReviewsOnPush = "dismiss_stale_reviews_on_push" - case requireCodeOwnerReview = "require_code_owner_review" - case requireLastPushApproval = "require_last_push_approval" - case requiredApprovingReviewCount = "required_approving_review_count" - case requiredReviewThreadResolution = "required_review_thread_resolution" - } - } - /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. - public var parameters: Components.Schemas.RepositoryRulePullRequest.ParametersPayload? - /// Creates a new `RepositoryRulePullRequest`. + /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple`. + public struct CodeOfConductSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct-simple/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `CodeOfConductSimple`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - url: + /// - key: + /// - name: + /// - htmlUrl: public init( - _type: Components.Schemas.RepositoryRulePullRequest._TypePayload, - parameters: Components.Schemas.RepositoryRulePullRequest.ParametersPayload? = nil + url: Swift.String, + key: Swift.String, + name: Swift.String, + htmlUrl: Swift.String? = nil ) { - self._type = _type - self.parameters = parameters + self.url = url + self.key = key + self.name = name + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case url + case key + case name + case htmlUrl = "html_url" } } - /// Required status check + /// Full Repository /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration`. - public struct RepositoryRuleParamsStatusCheckConfiguration: Codable, Hashable, Sendable { - /// The status check context name that must be present on the commit. + /// - Remark: Generated from `#/components/schemas/full-repository`. + public struct FullRepository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/full-repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/full-repository/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/full-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/git_url`. + public var gitUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/ssh_url`. + public var sshUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/clone_url`. + public var cloneUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/svn_url`. + public var svnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/forks_count`. + public var forksCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/stargazers_count`. + public var stargazersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/watchers_count`. + public var watchersCount: Swift.Int + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration/context`. - public var context: Swift.String - /// The optional integration ID that this status check must originate from. + /// - Remark: Generated from `#/components/schemas/full-repository/size`. + public var size: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/default_branch`. + public var defaultBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/full-repository/open_issues_count`. + public var openIssuesCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/topics`. + public var topics: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/full-repository/has_issues`. + public var hasIssues: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_projects`. + public var hasProjects: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_wiki`. + public var hasWiki: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_pages`. + public var hasPages: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/has_downloads`. + public var hasDownloads: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/has_discussions`. + public var hasDiscussions: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/archived`. + public var archived: Swift.Bool + /// Returns whether or not this repository disabled. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration/integration_id`. - public var integrationId: Swift.Int? - /// Creates a new `RepositoryRuleParamsStatusCheckConfiguration`. + /// - Remark: Generated from `#/components/schemas/full-repository/disabled`. + public var disabled: Swift.Bool + /// The repository visibility: public, private, or internal. /// - /// - Parameters: - /// - context: The status check context name that must be present on the commit. - /// - integrationId: The optional integration ID that this status check must originate from. - public init( - context: Swift.String, - integrationId: Swift.Int? = nil - ) { - self.context = context - self.integrationId = integrationId - } - public enum CodingKeys: String, CodingKey { - case context - case integrationId = "integration_id" - } - } - /// Choose which status checks must pass before the ref is updated. When enabled, commits must first be pushed to another ref where the checks pass. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks`. - public struct RepositoryRuleRequiredStatusChecks: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case requiredStatusChecks = "required_status_checks" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/type`. - public var _type: Components.Schemas.RepositoryRuleRequiredStatusChecks._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// Allow repositories and branches to be created if a check would otherwise prohibit it. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/do_not_enforce_on_create`. - public var doNotEnforceOnCreate: Swift.Bool? - /// Status checks that are required. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/required_status_checks`. - public var requiredStatusChecks: [Components.Schemas.RepositoryRuleParamsStatusCheckConfiguration] - /// Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/strict_required_status_checks_policy`. - public var strictRequiredStatusChecksPolicy: Swift.Bool - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/full-repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/pushed_at`. + public var pushedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/full-repository/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/full-repository/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/full-repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/full-repository/permissions/admin`. + public var admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/full-repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/permissions/pull`. + public var pull: Swift.Bool + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - doNotEnforceOnCreate: Allow repositories and branches to be created if a check would otherwise prohibit it. - /// - requiredStatusChecks: Status checks that are required. - /// - strictRequiredStatusChecksPolicy: Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. + /// - admin: + /// - maintain: + /// - push: + /// - triage: + /// - pull: public init( - doNotEnforceOnCreate: Swift.Bool? = nil, - requiredStatusChecks: [Components.Schemas.RepositoryRuleParamsStatusCheckConfiguration], - strictRequiredStatusChecksPolicy: Swift.Bool + admin: Swift.Bool, + maintain: Swift.Bool? = nil, + push: Swift.Bool, + triage: Swift.Bool? = nil, + pull: Swift.Bool ) { - self.doNotEnforceOnCreate = doNotEnforceOnCreate - self.requiredStatusChecks = requiredStatusChecks - self.strictRequiredStatusChecksPolicy = strictRequiredStatusChecksPolicy + self.admin = admin + self.maintain = maintain + self.push = push + self.triage = triage + self.pull = pull } public enum CodingKeys: String, CodingKey { - case doNotEnforceOnCreate = "do_not_enforce_on_create" - case requiredStatusChecks = "required_status_checks" - case strictRequiredStatusChecksPolicy = "strict_required_status_checks_policy" + case admin + case maintain + case push + case triage + case pull } } - /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters`. - public var parameters: Components.Schemas.RepositoryRuleRequiredStatusChecks.ParametersPayload? - /// Creates a new `RepositoryRuleRequiredStatusChecks`. - /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleRequiredStatusChecks._TypePayload, - parameters: Components.Schemas.RepositoryRuleRequiredStatusChecks.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// Prevent users with push access from force pushing to refs. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward`. - public struct RepositoryRuleNonFastForward: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case nonFastForward = "non_fast_forward" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward/type`. - public var _type: Components.Schemas.RepositoryRuleNonFastForward._TypePayload - /// Creates a new `RepositoryRuleNonFastForward`. - /// - /// - Parameters: - /// - _type: - public init(_type: Components.Schemas.RepositoryRuleNonFastForward._TypePayload) { - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - } - } - /// Parameters to be used for the commit_message_pattern rule - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern`. - public struct RepositoryRuleCommitMessagePattern: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case commitMessagePattern = "commit_message_pattern" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/type`. - public var _type: Components.Schemas.RepositoryRuleCommitMessagePattern._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/name`. - public var name: Swift.String? - /// If true, the rule will fail if the pattern matches. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/negate`. - public var negate: Swift.Bool? - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/operator`. - @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { - case startsWith = "starts_with" - case endsWith = "ends_with" - case contains = "contains" - case regex = "regex" - } - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/operator`. - public var _operator: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload.OperatorPayload - /// The pattern to match with. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/pattern`. - public var pattern: Swift.String - /// Creates a new `ParametersPayload`. - /// - /// - Parameters: - /// - name: How this rule will appear to users. - /// - negate: If true, the rule will fail if the pattern matches. - /// - _operator: The operator to use for matching. - /// - pattern: The pattern to match with. - public init( - name: Swift.String? = nil, - negate: Swift.Bool? = nil, - _operator: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload.OperatorPayload, - pattern: Swift.String - ) { - self.name = name - self.negate = negate - self._operator = _operator - self.pattern = pattern - } - public enum CodingKeys: String, CodingKey { - case name - case negate - case _operator = "operator" - case pattern - } + /// - Remark: Generated from `#/components/schemas/full-repository/permissions`. + public var permissions: Components.Schemas.FullRepository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_rebase_merge`. + public var allowRebaseMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/template_repository`. + public var templateRepository: Components.Schemas.NullableRepository? + /// - Remark: Generated from `#/components/schemas/full-repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_squash_merge`. + public var allowSquashMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_auto_merge`. + public var allowAutoMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_merge_commit`. + public var allowMergeCommit: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_update_branch`. + public var allowUpdateBranch: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/use_squash_pr_title_as_default`. + public var useSquashPrTitleAsDefault: Swift.Bool? + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_title`. + @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case commitOrPrTitle = "COMMIT_OR_PR_TITLE" } - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters`. - public var parameters: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload? - /// Creates a new `RepositoryRuleCommitMessagePattern`. + /// The default value for a squash merge commit title: /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleCommitMessagePattern._TypePayload, - parameters: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_title`. + public var squashMergeCommitTitle: Components.Schemas.FullRepository.SquashMergeCommitTitlePayload? + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_message`. + @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case commitMessages = "COMMIT_MESSAGES" + case blank = "BLANK" } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/squash_merge_commit_message`. + public var squashMergeCommitMessage: Components.Schemas.FullRepository.SquashMergeCommitMessagePayload? + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_title`. + @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case mergeMessage = "MERGE_MESSAGE" } - } - /// Parameters to be used for the commit_author_email_pattern rule - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern`. - public struct RepositoryRuleCommitAuthorEmailPattern: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case commitAuthorEmailPattern = "commit_author_email_pattern" + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_title`. + public var mergeCommitTitle: Components.Schemas.FullRepository.MergeCommitTitlePayload? + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_message`. + @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case prTitle = "PR_TITLE" + case blank = "BLANK" } - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/type`. - public var _type: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/name`. - public var name: Swift.String? - /// If true, the rule will fail if the pattern matches. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/negate`. - public var negate: Swift.Bool? - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/operator`. - @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { - case startsWith = "starts_with" - case endsWith = "ends_with" - case contains = "contains" - case regex = "regex" - } - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/operator`. - public var _operator: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload.OperatorPayload - /// The pattern to match with. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/pattern`. - public var pattern: Swift.String - /// Creates a new `ParametersPayload`. + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/merge_commit_message`. + public var mergeCommitMessage: Components.Schemas.FullRepository.MergeCommitMessagePayload? + /// - Remark: Generated from `#/components/schemas/full-repository/allow_forking`. + public var allowForking: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/subscribers_count`. + public var subscribersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/network_count`. + public var networkCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/full-repository/organization`. + public var organization: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/full-repository/parent`. + public var parent: Components.Schemas.Repository? + /// - Remark: Generated from `#/components/schemas/full-repository/source`. + public var source: Components.Schemas.Repository? + /// - Remark: Generated from `#/components/schemas/full-repository/forks`. + public var forks: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/master_branch`. + public var masterBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/full-repository/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/full-repository/watchers`. + public var watchers: Swift.Int + /// Whether anonymous git access is allowed. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/anonymous_access_enabled`. + public var anonymousAccessEnabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/full-repository/code_of_conduct`. + public var codeOfConduct: Components.Schemas.CodeOfConductSimple? + /// - Remark: Generated from `#/components/schemas/full-repository/security_and_analysis`. + public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. - /// - negate: If true, the rule will fail if the pattern matches. - /// - _operator: The operator to use for matching. - /// - pattern: The pattern to match with. - public init( - name: Swift.String? = nil, - negate: Swift.Bool? = nil, - _operator: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload.OperatorPayload, - pattern: Swift.String - ) { - self.name = name - self.negate = negate - self._operator = _operator - self.pattern = pattern + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties } - public enum CodingKeys: String, CodingKey { - case name - case negate - case _operator = "operator" - case pattern + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters`. - public var parameters: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload? - /// Creates a new `RepositoryRuleCommitAuthorEmailPattern`. + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/full-repository/custom_properties`. + public var customProperties: Components.Schemas.FullRepository.CustomPropertiesPayload? + /// Creates a new `FullRepository`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - id: + /// - nodeId: + /// - name: + /// - fullName: + /// - owner: + /// - _private: + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: + /// - openIssuesCount: + /// - isTemplate: + /// - topics: + /// - hasIssues: + /// - hasProjects: + /// - hasWiki: + /// - hasPages: + /// - hasDownloads: + /// - hasDiscussions: + /// - archived: + /// - disabled: Returns whether or not this repository disabled. + /// - visibility: The repository visibility: public, private, or internal. + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - permissions: + /// - allowRebaseMerge: + /// - templateRepository: + /// - tempCloneToken: + /// - allowSquashMerge: + /// - allowAutoMerge: + /// - deleteBranchOnMerge: + /// - allowMergeCommit: + /// - allowUpdateBranch: + /// - useSquashPrTitleAsDefault: + /// - squashMergeCommitTitle: The default value for a squash merge commit title: + /// - squashMergeCommitMessage: The default value for a squash merge commit message: + /// - mergeCommitTitle: The default value for a merge commit title. + /// - mergeCommitMessage: The default value for a merge commit message. + /// - allowForking: + /// - webCommitSignoffRequired: + /// - subscribersCount: + /// - networkCount: + /// - license: + /// - organization: + /// - parent: + /// - source: + /// - forks: + /// - masterBranch: + /// - openIssues: + /// - watchers: + /// - anonymousAccessEnabled: Whether anonymous git access is allowed. + /// - codeOfConduct: + /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( - _type: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern._TypePayload, - parameters: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload? = nil + id: Swift.Int64, + nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int, + stargazersCount: Swift.Int, + watchersCount: Swift.Int, + size: Swift.Int, + defaultBranch: Swift.String, + openIssuesCount: Swift.Int, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool, + hasProjects: Swift.Bool, + hasWiki: Swift.Bool, + hasPages: Swift.Bool, + hasDownloads: Swift.Bool? = nil, + hasDiscussions: Swift.Bool, + archived: Swift.Bool, + disabled: Swift.Bool, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + permissions: Components.Schemas.FullRepository.PermissionsPayload? = nil, + allowRebaseMerge: Swift.Bool? = nil, + templateRepository: Components.Schemas.NullableRepository? = nil, + tempCloneToken: Swift.String? = nil, + allowSquashMerge: Swift.Bool? = nil, + allowAutoMerge: Swift.Bool? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + allowMergeCommit: Swift.Bool? = nil, + allowUpdateBranch: Swift.Bool? = nil, + useSquashPrTitleAsDefault: Swift.Bool? = nil, + squashMergeCommitTitle: Components.Schemas.FullRepository.SquashMergeCommitTitlePayload? = nil, + squashMergeCommitMessage: Components.Schemas.FullRepository.SquashMergeCommitMessagePayload? = nil, + mergeCommitTitle: Components.Schemas.FullRepository.MergeCommitTitlePayload? = nil, + mergeCommitMessage: Components.Schemas.FullRepository.MergeCommitMessagePayload? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + subscribersCount: Swift.Int, + networkCount: Swift.Int, + license: Components.Schemas.NullableLicenseSimple? = nil, + organization: Components.Schemas.NullableSimpleUser? = nil, + parent: Components.Schemas.Repository? = nil, + source: Components.Schemas.Repository? = nil, + forks: Swift.Int, + masterBranch: Swift.String? = nil, + openIssues: Swift.Int, + watchers: Swift.Int, + anonymousAccessEnabled: Swift.Bool? = nil, + codeOfConduct: Components.Schemas.CodeOfConductSimple? = nil, + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.FullRepository.CustomPropertiesPayload? = nil ) { - self._type = _type - self.parameters = parameters + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.permissions = permissions + self.allowRebaseMerge = allowRebaseMerge + self.templateRepository = templateRepository + self.tempCloneToken = tempCloneToken + self.allowSquashMerge = allowSquashMerge + self.allowAutoMerge = allowAutoMerge + self.deleteBranchOnMerge = deleteBranchOnMerge + self.allowMergeCommit = allowMergeCommit + self.allowUpdateBranch = allowUpdateBranch + self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault + self.squashMergeCommitTitle = squashMergeCommitTitle + self.squashMergeCommitMessage = squashMergeCommitMessage + self.mergeCommitTitle = mergeCommitTitle + self.mergeCommitMessage = mergeCommitMessage + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.subscribersCount = subscribersCount + self.networkCount = networkCount + self.license = license + self.organization = organization + self.parent = parent + self.source = source + self.forks = forks + self.masterBranch = masterBranch + self.openIssues = openIssues + self.watchers = watchers + self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeOfConduct = codeOfConduct + self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case allowRebaseMerge = "allow_rebase_merge" + case templateRepository = "template_repository" + case tempCloneToken = "temp_clone_token" + case allowSquashMerge = "allow_squash_merge" + case allowAutoMerge = "allow_auto_merge" + case deleteBranchOnMerge = "delete_branch_on_merge" + case allowMergeCommit = "allow_merge_commit" + case allowUpdateBranch = "allow_update_branch" + case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" + case squashMergeCommitTitle = "squash_merge_commit_title" + case squashMergeCommitMessage = "squash_merge_commit_message" + case mergeCommitTitle = "merge_commit_title" + case mergeCommitMessage = "merge_commit_message" + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case subscribersCount = "subscribers_count" + case networkCount = "network_count" + case license + case organization + case parent + case source + case forks + case masterBranch = "master_branch" + case openIssues = "open_issues" + case watchers + case anonymousAccessEnabled = "anonymous_access_enabled" + case codeOfConduct = "code_of_conduct" + case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } - /// Parameters to be used for the committer_email_pattern rule + /// The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern`. - public struct RepositoryRuleCommitterEmailPattern: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case committerEmailPattern = "committer_email_pattern" + /// - Remark: Generated from `#/components/schemas/repository-rule-enforcement`. + @frozen public enum RepositoryRuleEnforcement: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case active = "active" + case evaluate = "evaluate" + } + /// An actor that can bypass rules in a ruleset + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor`. + public struct RepositoryRulesetBypassActor: Codable, Hashable, Sendable { + /// The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_id`. + public var actorId: Swift.Int? + /// The type of actor that can bypass a ruleset. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. + @frozen public enum ActorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case integration = "Integration" + case organizationAdmin = "OrganizationAdmin" + case repositoryRole = "RepositoryRole" + case team = "Team" + case deployKey = "DeployKey" } - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/type`. - public var _type: Components.Schemas.RepositoryRuleCommitterEmailPattern._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/name`. - public var name: Swift.String? - /// If true, the rule will fail if the pattern matches. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/negate`. - public var negate: Swift.Bool? - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/operator`. - @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { - case startsWith = "starts_with" - case endsWith = "ends_with" - case contains = "contains" - case regex = "regex" - } - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/operator`. - public var _operator: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload.OperatorPayload - /// The pattern to match with. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/pattern`. - public var pattern: Swift.String - /// Creates a new `ParametersPayload`. - /// - /// - Parameters: - /// - name: How this rule will appear to users. - /// - negate: If true, the rule will fail if the pattern matches. - /// - _operator: The operator to use for matching. - /// - pattern: The pattern to match with. - public init( - name: Swift.String? = nil, - negate: Swift.Bool? = nil, - _operator: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload.OperatorPayload, - pattern: Swift.String - ) { - self.name = name - self.negate = negate - self._operator = _operator - self.pattern = pattern - } - public enum CodingKeys: String, CodingKey { - case name - case negate - case _operator = "operator" - case pattern - } + /// The type of actor that can bypass a ruleset. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. + public var actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. + @frozen public enum BypassModePayload: String, Codable, Hashable, Sendable, CaseIterable { + case always = "always" + case pullRequest = "pull_request" + case exempt = "exempt" } - /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters`. - public var parameters: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload? - /// Creates a new `RepositoryRuleCommitterEmailPattern`. + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. + public var bypassMode: Components.Schemas.RepositoryRulesetBypassActor.BypassModePayload? + /// Creates a new `RepositoryRulesetBypassActor`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - actorId: The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// - actorType: The type of actor that can bypass a ruleset. + /// - bypassMode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. public init( - _type: Components.Schemas.RepositoryRuleCommitterEmailPattern._TypePayload, - parameters: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload? = nil + actorId: Swift.Int? = nil, + actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload, + bypassMode: Components.Schemas.RepositoryRulesetBypassActor.BypassModePayload? = nil ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// Parameters to be used for the branch_name_pattern rule - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern`. - public struct RepositoryRuleBranchNamePattern: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case branchNamePattern = "branch_name_pattern" + self.actorId = actorId + self.actorType = actorType + self.bypassMode = bypassMode } - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/type`. - public var _type: Components.Schemas.RepositoryRuleBranchNamePattern._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/name`. - public var name: Swift.String? - /// If true, the rule will fail if the pattern matches. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/negate`. - public var negate: Swift.Bool? - /// The operator to use for matching. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/operator`. - @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { - case startsWith = "starts_with" - case endsWith = "ends_with" - case contains = "contains" - case regex = "regex" - } - /// The operator to use for matching. + public enum CodingKeys: String, CodingKey { + case actorId = "actor_id" + case actorType = "actor_type" + case bypassMode = "bypass_mode" + } + } + /// Parameters for a repository ruleset ref name condition + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions`. + public struct RepositoryRulesetConditions: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name`. + public struct RefNamePayload: Codable, Hashable, Sendable { + /// Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/operator`. - public var _operator: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload.OperatorPayload - /// The pattern to match with. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name/include`. + public var include: [Swift.String]? + /// Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/pattern`. - public var pattern: Swift.String - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name/exclude`. + public var exclude: [Swift.String]? + /// Creates a new `RefNamePayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. - /// - negate: If true, the rule will fail if the pattern matches. - /// - _operator: The operator to use for matching. - /// - pattern: The pattern to match with. + /// - include: Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. + /// - exclude: Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. public init( - name: Swift.String? = nil, - negate: Swift.Bool? = nil, - _operator: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload.OperatorPayload, - pattern: Swift.String + include: [Swift.String]? = nil, + exclude: [Swift.String]? = nil ) { - self.name = name - self.negate = negate - self._operator = _operator - self.pattern = pattern + self.include = include + self.exclude = exclude } public enum CodingKeys: String, CodingKey { - case name - case negate - case _operator = "operator" - case pattern + case include + case exclude } } - /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters`. - public var parameters: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload? - /// Creates a new `RepositoryRuleBranchNamePattern`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions/ref_name`. + public var refName: Components.Schemas.RepositoryRulesetConditions.RefNamePayload? + /// Creates a new `RepositoryRulesetConditions`. /// /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleBranchNamePattern._TypePayload, - parameters: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - refName: + public init(refName: Components.Schemas.RepositoryRulesetConditions.RefNamePayload? = nil) { + self.refName = refName } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case refName = "ref_name" } } - /// Parameters to be used for the tag_name_pattern rule + /// Parameters for a repository name condition /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern`. - public struct RepositoryRuleTagNamePattern: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case tagNamePattern = "tag_name_pattern" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/type`. - public var _type: Components.Schemas.RepositoryRuleTagNamePattern._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// How this rule will appear to users. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/name`. - public var name: Swift.String? - /// If true, the rule will fail if the pattern matches. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/negate`. - public var negate: Swift.Bool? - /// The operator to use for matching. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target`. + public struct RepositoryRulesetConditionsRepositoryNameTarget: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name`. + public struct RepositoryNamePayload: Codable, Hashable, Sendable { + /// Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/operator`. - @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { - case startsWith = "starts_with" - case endsWith = "ends_with" - case contains = "contains" - case regex = "regex" - } - /// The operator to use for matching. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/include`. + public var include: [Swift.String]? + /// Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/operator`. - public var _operator: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload.OperatorPayload - /// The pattern to match with. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/exclude`. + public var exclude: [Swift.String]? + /// Whether renaming of target repositories is prevented. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/pattern`. - public var pattern: Swift.String - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name/protected`. + public var protected: Swift.Bool? + /// Creates a new `RepositoryNamePayload`. /// /// - Parameters: - /// - name: How this rule will appear to users. - /// - negate: If true, the rule will fail if the pattern matches. - /// - _operator: The operator to use for matching. - /// - pattern: The pattern to match with. + /// - include: Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories. + /// - exclude: Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. + /// - protected: Whether renaming of target repositories is prevented. public init( - name: Swift.String? = nil, - negate: Swift.Bool? = nil, - _operator: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload.OperatorPayload, - pattern: Swift.String + include: [Swift.String]? = nil, + exclude: [Swift.String]? = nil, + protected: Swift.Bool? = nil ) { - self.name = name - self.negate = negate - self._operator = _operator - self.pattern = pattern + self.include = include + self.exclude = exclude + self.protected = protected } public enum CodingKeys: String, CodingKey { - case name - case negate - case _operator = "operator" - case pattern + case include + case exclude + case protected } } - /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters`. - public var parameters: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload? - /// Creates a new `RepositoryRuleTagNamePattern`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-name-target/repository_name`. + public var repositoryName: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget.RepositoryNamePayload + /// Creates a new `RepositoryRulesetConditionsRepositoryNameTarget`. /// /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleTagNamePattern._TypePayload, - parameters: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - repositoryName: + public init(repositoryName: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget.RepositoryNamePayload) { + self.repositoryName = repositoryName } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case repositoryName = "repository_name" } } - /// Prevent commits that include changes in specified file and folder paths from being pushed to the commit graph. This includes absolute paths that contain file names. + /// Parameters for a repository ID condition /// - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction`. - public struct RepositoryRuleFilePathRestriction: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case filePathRestriction = "file_path_restriction" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. - public var _type: Components.Schemas.RepositoryRuleFilePathRestriction._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// The file paths that are restricted from being pushed to the commit graph. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target`. + public struct RepositoryRulesetConditionsRepositoryIdTarget: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id`. + public struct RepositoryIdPayload: Codable, Hashable, Sendable { + /// The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters/restricted_file_paths`. - public var restrictedFilePaths: [Swift.String] - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id/repository_ids`. + public var repositoryIds: [Swift.Int]? + /// Creates a new `RepositoryIdPayload`. /// /// - Parameters: - /// - restrictedFilePaths: The file paths that are restricted from being pushed to the commit graph. - public init(restrictedFilePaths: [Swift.String]) { - self.restrictedFilePaths = restrictedFilePaths + /// - repositoryIds: The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. + public init(repositoryIds: [Swift.Int]? = nil) { + self.repositoryIds = repositoryIds } public enum CodingKeys: String, CodingKey { - case restrictedFilePaths = "restricted_file_paths" + case repositoryIds = "repository_ids" } } - /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. - public var parameters: Components.Schemas.RepositoryRuleFilePathRestriction.ParametersPayload? - /// Creates a new `RepositoryRuleFilePathRestriction`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-id-target/repository_id`. + public var repositoryId: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget.RepositoryIdPayload + /// Creates a new `RepositoryRulesetConditionsRepositoryIdTarget`. /// /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleFilePathRestriction._TypePayload, - parameters: Components.Schemas.RepositoryRuleFilePathRestriction.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - repositoryId: + public init(repositoryId: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget.RepositoryIdPayload) { + self.repositoryId = repositoryId } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case repositoryId = "repository_id" } } - /// Prevent commits that include file paths that exceed the specified character limit from being pushed to the commit graph. + /// Parameters for a targeting a repository property /// - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length`. - public struct RepositoryRuleMaxFilePathLength: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case maxFilePathLength = "max_file_path_length" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. - public var _type: Components.Schemas.RepositoryRuleMaxFilePathLength._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// The maximum amount of characters allowed in file paths. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters/max_file_path_length`. - public var maxFilePathLength: Swift.Int - /// Creates a new `ParametersPayload`. - /// - /// - Parameters: - /// - maxFilePathLength: The maximum amount of characters allowed in file paths. - public init(maxFilePathLength: Swift.Int) { - self.maxFilePathLength = maxFilePathLength - } - public enum CodingKeys: String, CodingKey { - case maxFilePathLength = "max_file_path_length" - } + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec`. + public struct RepositoryRulesetConditionsRepositoryPropertySpec: Codable, Hashable, Sendable { + /// The name of the repository property to target + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/name`. + public var name: Swift.String + /// The values to match for the repository property + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/property_values`. + public var propertyValues: [Swift.String] + /// The source of the repository property. Defaults to 'custom' if not specified. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/source`. + @frozen public enum SourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case custom = "custom" + case system = "system" } - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. - public var parameters: Components.Schemas.RepositoryRuleMaxFilePathLength.ParametersPayload? - /// Creates a new `RepositoryRuleMaxFilePathLength`. + /// The source of the repository property. Defaults to 'custom' if not specified. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/source`. + public var source: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec.SourcePayload? + /// Creates a new `RepositoryRulesetConditionsRepositoryPropertySpec`. /// /// - Parameters: - /// - _type: - /// - parameters: + /// - name: The name of the repository property to target + /// - propertyValues: The values to match for the repository property + /// - source: The source of the repository property. Defaults to 'custom' if not specified. public init( - _type: Components.Schemas.RepositoryRuleMaxFilePathLength._TypePayload, - parameters: Components.Schemas.RepositoryRuleMaxFilePathLength.ParametersPayload? = nil + name: Swift.String, + propertyValues: [Swift.String], + source: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec.SourcePayload? = nil ) { - self._type = _type - self.parameters = parameters + self.name = name + self.propertyValues = propertyValues + self.source = source } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case name + case propertyValues = "property_values" + case source } } - /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. + /// Parameters for a repository property condition /// - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction`. - public struct RepositoryRuleFileExtensionRestriction: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case fileExtensionRestriction = "file_extension_restriction" - } - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. - public var _type: Components.Schemas.RepositoryRuleFileExtensionRestriction._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// The file extensions that are restricted from being pushed to the commit graph. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target`. + public struct RepositoryRulesetConditionsRepositoryPropertyTarget: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. + public struct RepositoryPropertyPayload: Codable, Hashable, Sendable { + /// The repository properties and values to include. All of these properties must match for the condition to pass. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters/restricted_file_extensions`. - public var restrictedFileExtensions: [Swift.String] - /// Creates a new `ParametersPayload`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/include`. + public var include: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? + /// The repository properties and values to exclude. The condition will not pass if any of these properties match. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/exclude`. + public var exclude: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? + /// Creates a new `RepositoryPropertyPayload`. /// /// - Parameters: - /// - restrictedFileExtensions: The file extensions that are restricted from being pushed to the commit graph. - public init(restrictedFileExtensions: [Swift.String]) { - self.restrictedFileExtensions = restrictedFileExtensions + /// - include: The repository properties and values to include. All of these properties must match for the condition to pass. + /// - exclude: The repository properties and values to exclude. The condition will not pass if any of these properties match. + public init( + include: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? = nil, + exclude: [Components.Schemas.RepositoryRulesetConditionsRepositoryPropertySpec]? = nil + ) { + self.include = include + self.exclude = exclude } public enum CodingKeys: String, CodingKey { - case restrictedFileExtensions = "restricted_file_extensions" + case include + case exclude } } - /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. - public var parameters: Components.Schemas.RepositoryRuleFileExtensionRestriction.ParametersPayload? - /// Creates a new `RepositoryRuleFileExtensionRestriction`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. + public var repositoryProperty: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget.RepositoryPropertyPayload + /// Creates a new `RepositoryRulesetConditionsRepositoryPropertyTarget`. /// /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleFileExtensionRestriction._TypePayload, - parameters: Components.Schemas.RepositoryRuleFileExtensionRestriction.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - repositoryProperty: + public init(repositoryProperty: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget.RepositoryPropertyPayload) { + self.repositoryProperty = repositoryProperty } public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + case repositoryProperty = "repository_property" } } - /// Prevent commits with individual files that exceed the specified limit from being pushed to the commit graph. + /// Conditions for an organization ruleset. + /// The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties. + /// The push rulesets conditions object does not require the `ref_name` property. + /// For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size`. - public struct RepositoryRuleMaxFileSize: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case maxFileSize = "max_file_size" + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions`. + @frozen public enum OrgRulesetConditions: Codable, Hashable, Sendable { + /// Conditions to target repositories by name and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1/value1`. + public var value1: Components.Schemas.RepositoryRulesetConditions + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1/value2`. + public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRulesetConditions, + value2: Components.Schemas.RepositoryRulesetConditionsRepositoryNameTarget + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } } - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. - public var _type: Components.Schemas.RepositoryRuleMaxFileSize._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. - public struct ParametersPayload: Codable, Hashable, Sendable { - /// The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + /// Conditions to target repositories by name and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case1`. + case case1(Components.Schemas.OrgRulesetConditions.Case1Payload) + /// Conditions to target repositories by id and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2/value1`. + public var value1: Components.Schemas.RepositoryRulesetConditions + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2/value2`. + public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget + /// Creates a new `Case2Payload`. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters/max_file_size`. - public var maxFileSize: Swift.Int - /// Creates a new `ParametersPayload`. + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRulesetConditions, + value2: Components.Schemas.RepositoryRulesetConditionsRepositoryIdTarget + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// Conditions to target repositories by id and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2`. + case case2(Components.Schemas.OrgRulesetConditions.Case2Payload) + /// Conditions to target repositories by property and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value1`. + public var value1: Components.Schemas.RepositoryRulesetConditions + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value2`. + public var value2: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget + /// Creates a new `Case3Payload`. /// /// - Parameters: - /// - maxFileSize: The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). - public init(maxFileSize: Swift.Int) { - self.maxFileSize = maxFileSize + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRulesetConditions, + value2: Components.Schemas.RepositoryRulesetConditionsRepositoryPropertyTarget + ) { + self.value1 = value1 + self.value2 = value2 } - public enum CodingKeys: String, CodingKey { - case maxFileSize = "max_file_size" + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) } } - /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. - public var parameters: Components.Schemas.RepositoryRuleMaxFileSize.ParametersPayload? - /// Creates a new `RepositoryRuleMaxFileSize`. + /// Conditions to target repositories by property and refs by name /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.RepositoryRuleMaxFileSize._TypePayload, - parameters: Components.Schemas.RepositoryRuleMaxFileSize.ParametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. + case case3(Components.Schemas.OrgRulesetConditions.Case3Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters + 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) + case let .case3(value): + try value.encode(to: encoder) + } } } - /// A workflow that must run for this rule to pass + /// Only allow users with bypass permission to create matching refs. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference`. - public struct RepositoryRuleParamsWorkflowFileReference: Codable, Hashable, Sendable { - /// The path to the workflow file - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/path`. - public var path: Swift.String - /// The ref (branch or tag) of the workflow file to use - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/ref`. - public var ref: Swift.String? - /// The ID of the repository where the workflow is defined - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/repository_id`. - public var repositoryId: Swift.Int - /// The commit SHA of the workflow file to use - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/sha`. - public var sha: Swift.String? - /// Creates a new `RepositoryRuleParamsWorkflowFileReference`. + /// - Remark: Generated from `#/components/schemas/repository-rule-creation`. + public struct RepositoryRuleCreation: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-creation/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case creation = "creation" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-creation/type`. + public var _type: Components.Schemas.RepositoryRuleCreation._TypePayload + /// Creates a new `RepositoryRuleCreation`. /// /// - Parameters: - /// - path: The path to the workflow file - /// - ref: The ref (branch or tag) of the workflow file to use - /// - repositoryId: The ID of the repository where the workflow is defined - /// - sha: The commit SHA of the workflow file to use - public init( - path: Swift.String, - ref: Swift.String? = nil, - repositoryId: Swift.Int, - sha: Swift.String? = nil - ) { - self.path = path - self.ref = ref - self.repositoryId = repositoryId - self.sha = sha + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleCreation._TypePayload) { + self._type = _type } public enum CodingKeys: String, CodingKey { - case path - case ref - case repositoryId = "repository_id" - case sha + case _type = "type" } } - /// Require all changes made to a targeted branch to pass the specified workflows before they can be merged. + /// Only allow users with bypass permission to update matching refs. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows`. - public struct RepositoryRuleWorkflows: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/type`. + /// - Remark: Generated from `#/components/schemas/repository-rule-update`. + public struct RepositoryRuleUpdate: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-update/type`. @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case workflows = "workflows" + case update = "update" } - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/type`. - public var _type: Components.Schemas.RepositoryRuleWorkflows._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters`. + /// - Remark: Generated from `#/components/schemas/repository-rule-update/type`. + public var _type: Components.Schemas.RepositoryRuleUpdate._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// Allow repositories and branches to be created if a check would otherwise prohibit it. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters/do_not_enforce_on_create`. - public var doNotEnforceOnCreate: Swift.Bool? - /// Workflows that must pass for this rule to pass. + /// Branch can pull changes from its upstream repository /// - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters/workflows`. - public var workflows: [Components.Schemas.RepositoryRuleParamsWorkflowFileReference] + /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters/update_allows_fetch_and_merge`. + public var updateAllowsFetchAndMerge: Swift.Bool /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - doNotEnforceOnCreate: Allow repositories and branches to be created if a check would otherwise prohibit it. - /// - workflows: Workflows that must pass for this rule to pass. - public init( - doNotEnforceOnCreate: Swift.Bool? = nil, - workflows: [Components.Schemas.RepositoryRuleParamsWorkflowFileReference] - ) { - self.doNotEnforceOnCreate = doNotEnforceOnCreate - self.workflows = workflows + /// - updateAllowsFetchAndMerge: Branch can pull changes from its upstream repository + public init(updateAllowsFetchAndMerge: Swift.Bool) { + self.updateAllowsFetchAndMerge = updateAllowsFetchAndMerge } public enum CodingKeys: String, CodingKey { - case doNotEnforceOnCreate = "do_not_enforce_on_create" - case workflows + case updateAllowsFetchAndMerge = "update_allows_fetch_and_merge" } } - /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters`. - public var parameters: Components.Schemas.RepositoryRuleWorkflows.ParametersPayload? - /// Creates a new `RepositoryRuleWorkflows`. + /// - Remark: Generated from `#/components/schemas/repository-rule-update/parameters`. + public var parameters: Components.Schemas.RepositoryRuleUpdate.ParametersPayload? + /// Creates a new `RepositoryRuleUpdate`. /// /// - Parameters: /// - _type: /// - parameters: public init( - _type: Components.Schemas.RepositoryRuleWorkflows._TypePayload, - parameters: Components.Schemas.RepositoryRuleWorkflows.ParametersPayload? = nil + _type: Components.Schemas.RepositoryRuleUpdate._TypePayload, + parameters: Components.Schemas.RepositoryRuleUpdate.ParametersPayload? = nil ) { self._type = _type self.parameters = parameters @@ -12945,99 +12311,150 @@ public enum Components { case parameters } } - /// A tool that must provide code scanning results for this rule to pass. + /// Only allow users with bypass permissions to delete matching refs. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool`. - public struct RepositoryRuleParamsCodeScanningTool: Codable, Hashable, Sendable { - /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. - @frozen public enum AlertsThresholdPayload: String, Codable, Hashable, Sendable, CaseIterable { - case none = "none" - case errors = "errors" - case errorsAndWarnings = "errors_and_warnings" - case all = "all" + /// - Remark: Generated from `#/components/schemas/repository-rule-deletion`. + public struct RepositoryRuleDeletion: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-deletion/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case deletion = "deletion" } - /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. - public var alertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.AlertsThresholdPayload - /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// - Remark: Generated from `#/components/schemas/repository-rule-deletion/type`. + public var _type: Components.Schemas.RepositoryRuleDeletion._TypePayload + /// Creates a new `RepositoryRuleDeletion`. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. - @frozen public enum SecurityAlertsThresholdPayload: String, Codable, Hashable, Sendable, CaseIterable { - case none = "none" - case critical = "critical" - case highOrHigher = "high_or_higher" - case mediumOrHigher = "medium_or_higher" - case all = "all" + /// - Parameters: + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleDeletion._TypePayload) { + self._type = _type } - /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. - public var securityAlertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.SecurityAlertsThresholdPayload - /// The name of a code scanning tool - /// - /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/tool`. - public var tool: Swift.String - /// Creates a new `RepositoryRuleParamsCodeScanningTool`. + public enum CodingKeys: String, CodingKey { + case _type = "type" + } + } + /// Prevent merge commits from being pushed to matching refs. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history`. + public struct RepositoryRuleRequiredLinearHistory: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case requiredLinearHistory = "required_linear_history" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-required-linear-history/type`. + public var _type: Components.Schemas.RepositoryRuleRequiredLinearHistory._TypePayload + /// Creates a new `RepositoryRuleRequiredLinearHistory`. /// /// - Parameters: - /// - alertsThreshold: The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." - /// - securityAlertsThreshold: The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." - /// - tool: The name of a code scanning tool - public init( - alertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.AlertsThresholdPayload, - securityAlertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.SecurityAlertsThresholdPayload, - tool: Swift.String - ) { - self.alertsThreshold = alertsThreshold - self.securityAlertsThreshold = securityAlertsThreshold - self.tool = tool + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleRequiredLinearHistory._TypePayload) { + self._type = _type } public enum CodingKeys: String, CodingKey { - case alertsThreshold = "alerts_threshold" - case securityAlertsThreshold = "security_alerts_threshold" - case tool + case _type = "type" } } - /// Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. + /// Merges must be performed via a merge queue. /// - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning`. - public struct RepositoryRuleCodeScanning: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue`. + public struct RepositoryRuleMergeQueue: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/type`. @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case codeScanning = "code_scanning" + case mergeQueue = "merge_queue" } - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. - public var _type: Components.Schemas.RepositoryRuleCodeScanning._TypePayload - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/type`. + public var _type: Components.Schemas.RepositoryRuleMergeQueue._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters`. public struct ParametersPayload: Codable, Hashable, Sendable { - /// Tools that must provide code scanning results for this rule to pass. + /// Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed /// - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters/code_scanning_tools`. - public var codeScanningTools: [Components.Schemas.RepositoryRuleParamsCodeScanningTool] + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/check_response_timeout_minutes`. + public var checkResponseTimeoutMinutes: Swift.Int + /// When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/grouping_strategy`. + @frozen public enum GroupingStrategyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case allgreen = "ALLGREEN" + case headgreen = "HEADGREEN" + } + /// When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/grouping_strategy`. + public var groupingStrategy: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.GroupingStrategyPayload + /// Limit the number of queued pull requests requesting checks and workflow runs at the same time. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/max_entries_to_build`. + public var maxEntriesToBuild: Swift.Int + /// The maximum number of PRs that will be merged together in a group. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/max_entries_to_merge`. + public var maxEntriesToMerge: Swift.Int + /// Method to use when merging changes from queued pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "MERGE" + case squash = "SQUASH" + case rebase = "REBASE" + } + /// Method to use when merging changes from queued pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/merge_method`. + public var mergeMethod: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.MergeMethodPayload + /// The minimum number of PRs that will be merged together in a group. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/min_entries_to_merge`. + public var minEntriesToMerge: Swift.Int + /// The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters/min_entries_to_merge_wait_minutes`. + public var minEntriesToMergeWaitMinutes: Swift.Int /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - codeScanningTools: Tools that must provide code scanning results for this rule to pass. - public init(codeScanningTools: [Components.Schemas.RepositoryRuleParamsCodeScanningTool]) { - self.codeScanningTools = codeScanningTools + /// - checkResponseTimeoutMinutes: Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed + /// - groupingStrategy: When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. + /// - maxEntriesToBuild: Limit the number of queued pull requests requesting checks and workflow runs at the same time. + /// - maxEntriesToMerge: The maximum number of PRs that will be merged together in a group. + /// - mergeMethod: Method to use when merging changes from queued pull requests. + /// - minEntriesToMerge: The minimum number of PRs that will be merged together in a group. + /// - minEntriesToMergeWaitMinutes: The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. + public init( + checkResponseTimeoutMinutes: Swift.Int, + groupingStrategy: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.GroupingStrategyPayload, + maxEntriesToBuild: Swift.Int, + maxEntriesToMerge: Swift.Int, + mergeMethod: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload.MergeMethodPayload, + minEntriesToMerge: Swift.Int, + minEntriesToMergeWaitMinutes: Swift.Int + ) { + self.checkResponseTimeoutMinutes = checkResponseTimeoutMinutes + self.groupingStrategy = groupingStrategy + self.maxEntriesToBuild = maxEntriesToBuild + self.maxEntriesToMerge = maxEntriesToMerge + self.mergeMethod = mergeMethod + self.minEntriesToMerge = minEntriesToMerge + self.minEntriesToMergeWaitMinutes = minEntriesToMergeWaitMinutes } public enum CodingKeys: String, CodingKey { - case codeScanningTools = "code_scanning_tools" + case checkResponseTimeoutMinutes = "check_response_timeout_minutes" + case groupingStrategy = "grouping_strategy" + case maxEntriesToBuild = "max_entries_to_build" + case maxEntriesToMerge = "max_entries_to_merge" + case mergeMethod = "merge_method" + case minEntriesToMerge = "min_entries_to_merge" + case minEntriesToMergeWaitMinutes = "min_entries_to_merge_wait_minutes" } } - /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. - public var parameters: Components.Schemas.RepositoryRuleCodeScanning.ParametersPayload? - /// Creates a new `RepositoryRuleCodeScanning`. + /// - Remark: Generated from `#/components/schemas/repository-rule-merge-queue/parameters`. + public var parameters: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload? + /// Creates a new `RepositoryRuleMergeQueue`. /// /// - Parameters: /// - _type: /// - parameters: public init( - _type: Components.Schemas.RepositoryRuleCodeScanning._TypePayload, - parameters: Components.Schemas.RepositoryRuleCodeScanning.ParametersPayload? = nil + _type: Components.Schemas.RepositoryRuleMergeQueue._TypePayload, + parameters: Components.Schemas.RepositoryRuleMergeQueue.ParametersPayload? = nil ) { self._type = _type self.parameters = parameters @@ -13047,4903 +12464,5397 @@ public enum Components { case parameters } } - /// A repository rule. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule`. - @frozen public enum RepositoryRule: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule/case1`. - case RepositoryRuleCreation(Components.Schemas.RepositoryRuleCreation) - /// - Remark: Generated from `#/components/schemas/repository-rule/case2`. - case RepositoryRuleUpdate(Components.Schemas.RepositoryRuleUpdate) - /// - Remark: Generated from `#/components/schemas/repository-rule/case3`. - case RepositoryRuleDeletion(Components.Schemas.RepositoryRuleDeletion) - /// - Remark: Generated from `#/components/schemas/repository-rule/case4`. - case RepositoryRuleRequiredLinearHistory(Components.Schemas.RepositoryRuleRequiredLinearHistory) - /// - Remark: Generated from `#/components/schemas/repository-rule/case5`. - case RepositoryRuleMergeQueue(Components.Schemas.RepositoryRuleMergeQueue) - /// - Remark: Generated from `#/components/schemas/repository-rule/case6`. - case RepositoryRuleRequiredDeployments(Components.Schemas.RepositoryRuleRequiredDeployments) - /// - Remark: Generated from `#/components/schemas/repository-rule/case7`. - case RepositoryRuleRequiredSignatures(Components.Schemas.RepositoryRuleRequiredSignatures) - /// - Remark: Generated from `#/components/schemas/repository-rule/case8`. - case RepositoryRulePullRequest(Components.Schemas.RepositoryRulePullRequest) - /// - Remark: Generated from `#/components/schemas/repository-rule/case9`. - case RepositoryRuleRequiredStatusChecks(Components.Schemas.RepositoryRuleRequiredStatusChecks) - /// - Remark: Generated from `#/components/schemas/repository-rule/case10`. - case RepositoryRuleNonFastForward(Components.Schemas.RepositoryRuleNonFastForward) - /// - Remark: Generated from `#/components/schemas/repository-rule/case11`. - case RepositoryRuleCommitMessagePattern(Components.Schemas.RepositoryRuleCommitMessagePattern) - /// - Remark: Generated from `#/components/schemas/repository-rule/case12`. - case RepositoryRuleCommitAuthorEmailPattern(Components.Schemas.RepositoryRuleCommitAuthorEmailPattern) - /// - Remark: Generated from `#/components/schemas/repository-rule/case13`. - case RepositoryRuleCommitterEmailPattern(Components.Schemas.RepositoryRuleCommitterEmailPattern) - /// - Remark: Generated from `#/components/schemas/repository-rule/case14`. - case RepositoryRuleBranchNamePattern(Components.Schemas.RepositoryRuleBranchNamePattern) - /// - Remark: Generated from `#/components/schemas/repository-rule/case15`. - case RepositoryRuleTagNamePattern(Components.Schemas.RepositoryRuleTagNamePattern) - /// - Remark: Generated from `#/components/schemas/repository-rule/case16`. - case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) - /// - Remark: Generated from `#/components/schemas/repository-rule/case17`. - case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) - /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. - case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) - /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. - case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) - /// - Remark: Generated from `#/components/schemas/repository-rule/case20`. - case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) - /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. - 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 = .RepositoryRuleMergeQueue(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 .RepositoryRuleMergeQueue(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) + /// Choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments`. + public struct RepositoryRuleRequiredDeployments: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case requiredDeployments = "required_deployments" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/type`. + public var _type: Components.Schemas.RepositoryRuleRequiredDeployments._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// The environments that must be successfully deployed to before branches can be merged. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters/required_deployment_environments`. + public var requiredDeploymentEnvironments: [Swift.String] + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - requiredDeploymentEnvironments: The environments that must be successfully deployed to before branches can be merged. + public init(requiredDeploymentEnvironments: [Swift.String]) { + self.requiredDeploymentEnvironments = requiredDeploymentEnvironments + } + public enum CodingKeys: String, CodingKey { + case requiredDeploymentEnvironments = "required_deployment_environments" } } + /// - Remark: Generated from `#/components/schemas/repository-rule-required-deployments/parameters`. + public var parameters: Components.Schemas.RepositoryRuleRequiredDeployments.ParametersPayload? + /// Creates a new `RepositoryRuleRequiredDeployments`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleRequiredDeployments._TypePayload, + parameters: Components.Schemas.RepositoryRuleRequiredDeployments.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } } - /// A set of rules to apply when specified conditions are met. + /// Commits pushed to matching refs must have verified signatures. /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset`. - public struct RepositoryRuleset: Codable, Hashable, Sendable { - /// The ID of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/id`. - public var id: Swift.Int - /// The name of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/name`. - public var name: Swift.String - /// The target of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. - @frozen public enum TargetPayload: String, Codable, Hashable, Sendable, CaseIterable { - case branch = "branch" - case tag = "tag" - case push = "push" - case repository = "repository" + /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures`. + public struct RepositoryRuleRequiredSignatures: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case requiredSignatures = "required_signatures" } - /// The target of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. - public var target: Components.Schemas.RepositoryRuleset.TargetPayload? - /// The type of the source of the ruleset + /// - Remark: Generated from `#/components/schemas/repository-rule-required-signatures/type`. + public var _type: Components.Schemas.RepositoryRuleRequiredSignatures._TypePayload + /// Creates a new `RepositoryRuleRequiredSignatures`. /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/source_type`. - @frozen public enum SourceTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case repository = "Repository" - case organization = "Organization" - case enterprise = "Enterprise" + /// - Parameters: + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleRequiredSignatures._TypePayload) { + self._type = _type } - /// The type of the source of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/source_type`. - public var sourceType: Components.Schemas.RepositoryRuleset.SourceTypePayload? - /// The name of the source - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/source`. - public var source: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-ruleset/enforcement`. - public var enforcement: Components.Schemas.RepositoryRuleEnforcement - /// The actors that can bypass the rules in this ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/bypass_actors`. - public var bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? - /// The bypass type of the user making the API request for this ruleset. This field is only returned when - /// querying the repository-level endpoint. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/current_user_can_bypass`. - @frozen public enum CurrentUserCanBypassPayload: String, Codable, Hashable, Sendable, CaseIterable { - case always = "always" - case pullRequestsOnly = "pull_requests_only" - case never = "never" + public enum CodingKeys: String, CodingKey { + case _type = "type" } - /// The bypass type of the user making the API request for this ruleset. This field is only returned when - /// querying the repository-level endpoint. - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/current_user_can_bypass`. - public var currentUserCanBypass: Components.Schemas.RepositoryRuleset.CurrentUserCanBypassPayload? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self`. - public struct _SelfPayload: Codable, Hashable, Sendable { - /// The URL of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self/href`. - public var href: Swift.String? - /// Creates a new `_SelfPayload`. - /// - /// - Parameters: - /// - href: The URL of the ruleset - public init(href: Swift.String? = nil) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } + } + /// Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request`. + public struct RepositoryRulePullRequest: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pullRequest = "pull_request" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/type`. + public var _type: Components.Schemas.RepositoryRulePullRequest._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/AllowedMergeMethodsPayload`. + @frozen public enum AllowedMergeMethodsPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" } - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self`. - public var _self: Components.Schemas.RepositoryRuleset._LinksPayload._SelfPayload? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html`. - public struct HtmlPayload: Codable, Hashable, Sendable { - /// The html URL of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html/href`. - public var href: Swift.String? - /// Creates a new `HtmlPayload`. - /// - /// - Parameters: - /// - href: The html URL of the ruleset - public init(href: Swift.String? = nil) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } + /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. + public typealias AllowedMergeMethodsPayload = [Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayloadPayload] + /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. + public var allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. + public var automaticCopilotCodeReviewEnabled: Swift.Bool? + /// New, reviewable commits pushed will dismiss previous pull request review approvals. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismiss_stale_reviews_on_push`. + public var dismissStaleReviewsOnPush: Swift.Bool + /// Require an approving review in pull requests that modify files that have a designated code owner. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/require_code_owner_review`. + public var requireCodeOwnerReview: Swift.Bool + /// Whether the most recent reviewable push must be approved by someone other than the person who pushed it. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/require_last_push_approval`. + public var requireLastPushApproval: Swift.Bool + /// The number of approving reviews that are required before a pull request can be merged. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_approving_review_count`. + public var requiredApprovingReviewCount: Swift.Int + /// All conversations on code must be resolved before a pull request can be merged. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/required_review_thread_resolution`. + public var requiredReviewThreadResolution: Swift.Bool + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// - automaticCopilotCodeReviewEnabled: Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. + /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. + /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. + /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. + /// - requiredApprovingReviewCount: The number of approving reviews that are required before a pull request can be merged. + /// - requiredReviewThreadResolution: All conversations on code must be resolved before a pull request can be merged. + public init( + allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? = nil, + automaticCopilotCodeReviewEnabled: Swift.Bool? = nil, + dismissStaleReviewsOnPush: Swift.Bool, + requireCodeOwnerReview: Swift.Bool, + requireLastPushApproval: Swift.Bool, + requiredApprovingReviewCount: Swift.Int, + requiredReviewThreadResolution: Swift.Bool + ) { + self.allowedMergeMethods = allowedMergeMethods + self.automaticCopilotCodeReviewEnabled = automaticCopilotCodeReviewEnabled + self.dismissStaleReviewsOnPush = dismissStaleReviewsOnPush + self.requireCodeOwnerReview = requireCodeOwnerReview + self.requireLastPushApproval = requireLastPushApproval + self.requiredApprovingReviewCount = requiredApprovingReviewCount + self.requiredReviewThreadResolution = requiredReviewThreadResolution } - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html`. - public var html: Components.Schemas.RepositoryRuleset._LinksPayload.HtmlPayload? - /// Creates a new `_LinksPayload`. + public enum CodingKeys: String, CodingKey { + case allowedMergeMethods = "allowed_merge_methods" + case automaticCopilotCodeReviewEnabled = "automatic_copilot_code_review_enabled" + case dismissStaleReviewsOnPush = "dismiss_stale_reviews_on_push" + case requireCodeOwnerReview = "require_code_owner_review" + case requireLastPushApproval = "require_last_push_approval" + case requiredApprovingReviewCount = "required_approving_review_count" + case requiredReviewThreadResolution = "required_review_thread_resolution" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. + public var parameters: Components.Schemas.RepositoryRulePullRequest.ParametersPayload? + /// Creates a new `RepositoryRulePullRequest`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRulePullRequest._TypePayload, + parameters: Components.Schemas.RepositoryRulePullRequest.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Required status check + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration`. + public struct RepositoryRuleParamsStatusCheckConfiguration: Codable, Hashable, Sendable { + /// The status check context name that must be present on the commit. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration/context`. + public var context: Swift.String + /// The optional integration ID that this status check must originate from. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-status-check-configuration/integration_id`. + public var integrationId: Swift.Int? + /// Creates a new `RepositoryRuleParamsStatusCheckConfiguration`. + /// + /// - Parameters: + /// - context: The status check context name that must be present on the commit. + /// - integrationId: The optional integration ID that this status check must originate from. + public init( + context: Swift.String, + integrationId: Swift.Int? = nil + ) { + self.context = context + self.integrationId = integrationId + } + public enum CodingKeys: String, CodingKey { + case context + case integrationId = "integration_id" + } + } + /// Choose which status checks must pass before the ref is updated. When enabled, commits must first be pushed to another ref where the checks pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks`. + public struct RepositoryRuleRequiredStatusChecks: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case requiredStatusChecks = "required_status_checks" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/type`. + public var _type: Components.Schemas.RepositoryRuleRequiredStatusChecks._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Allow repositories and branches to be created if a check would otherwise prohibit it. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/do_not_enforce_on_create`. + public var doNotEnforceOnCreate: Swift.Bool? + /// Status checks that are required. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/required_status_checks`. + public var requiredStatusChecks: [Components.Schemas.RepositoryRuleParamsStatusCheckConfiguration] + /// Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters/strict_required_status_checks_policy`. + public var strictRequiredStatusChecksPolicy: Swift.Bool + /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - _self: - /// - html: + /// - doNotEnforceOnCreate: Allow repositories and branches to be created if a check would otherwise prohibit it. + /// - requiredStatusChecks: Status checks that are required. + /// - strictRequiredStatusChecksPolicy: Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. public init( - _self: Components.Schemas.RepositoryRuleset._LinksPayload._SelfPayload? = nil, - html: Components.Schemas.RepositoryRuleset._LinksPayload.HtmlPayload? = nil + doNotEnforceOnCreate: Swift.Bool? = nil, + requiredStatusChecks: [Components.Schemas.RepositoryRuleParamsStatusCheckConfiguration], + strictRequiredStatusChecksPolicy: Swift.Bool ) { - self._self = _self - self.html = html + self.doNotEnforceOnCreate = doNotEnforceOnCreate + self.requiredStatusChecks = requiredStatusChecks + self.strictRequiredStatusChecksPolicy = strictRequiredStatusChecksPolicy } public enum CodingKeys: String, CodingKey { - case _self = "self" - case html + case doNotEnforceOnCreate = "do_not_enforce_on_create" + case requiredStatusChecks = "required_status_checks" + case strictRequiredStatusChecksPolicy = "strict_required_status_checks_policy" } } - /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links`. - public var _links: Components.Schemas.RepositoryRuleset._LinksPayload? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions`. - public struct ConditionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions/value1`. - public var value1: Components.Schemas.RepositoryRulesetConditions? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions/value2`. - public var value2: Components.Schemas.OrgRulesetConditions? - /// Creates a new `ConditionsPayload`. + /// - Remark: Generated from `#/components/schemas/repository-rule-required-status-checks/parameters`. + public var parameters: Components.Schemas.RepositoryRuleRequiredStatusChecks.ParametersPayload? + /// Creates a new `RepositoryRuleRequiredStatusChecks`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleRequiredStatusChecks._TypePayload, + parameters: Components.Schemas.RepositoryRuleRequiredStatusChecks.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent users with push access from force pushing to refs. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward`. + public struct RepositoryRuleNonFastForward: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case nonFastForward = "non_fast_forward" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-non-fast-forward/type`. + public var _type: Components.Schemas.RepositoryRuleNonFastForward._TypePayload + /// Creates a new `RepositoryRuleNonFastForward`. + /// + /// - Parameters: + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleNonFastForward._TypePayload) { + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + } + } + /// Parameters to be used for the commit_message_pattern rule + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern`. + public struct RepositoryRuleCommitMessagePattern: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case commitMessagePattern = "commit_message_pattern" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/type`. + public var _type: Components.Schemas.RepositoryRuleCommitMessagePattern._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// How this rule will appear to users. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/name`. + public var name: Swift.String? + /// If true, the rule will fail if the pattern matches. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/negate`. + public var negate: Swift.Bool? + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/operator`. + @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case startsWith = "starts_with" + case endsWith = "ends_with" + case contains = "contains" + case regex = "regex" + } + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/operator`. + public var _operator: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload.OperatorPayload + /// The pattern to match with. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters/pattern`. + public var pattern: Swift.String + /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - value1: - /// - value2: + /// - name: How this rule will appear to users. + /// - negate: If true, the rule will fail if the pattern matches. + /// - _operator: The operator to use for matching. + /// - pattern: The pattern to match with. public init( - value1: Components.Schemas.RepositoryRulesetConditions? = nil, - value2: Components.Schemas.OrgRulesetConditions? = nil + name: Swift.String? = nil, + negate: Swift.Bool? = nil, + _operator: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload.OperatorPayload, + pattern: Swift.String ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self.value1 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value2 = try .init(from: decoder) - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - self.value1, - self.value2 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + self.name = name + self.negate = negate + self._operator = _operator + self.pattern = pattern } - public func encode(to encoder: any Encoder) throws { - try self.value1?.encode(to: encoder) - try self.value2?.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case name + case negate + case _operator = "operator" + case pattern } } - /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions`. - public var conditions: Components.Schemas.RepositoryRuleset.ConditionsPayload? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/rules`. - public var rules: [Components.Schemas.RepositoryRule]? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/created_at`. - public var createdAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/repository-ruleset/updated_at`. - public var updatedAt: Foundation.Date? - /// Creates a new `RepositoryRuleset`. + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-message-pattern/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload? + /// Creates a new `RepositoryRuleCommitMessagePattern`. /// /// - Parameters: - /// - id: The ID of the ruleset - /// - name: The name of the ruleset - /// - target: The target of the ruleset - /// - sourceType: The type of the source of the ruleset - /// - source: The name of the source - /// - enforcement: - /// - bypassActors: The actors that can bypass the rules in this ruleset - /// - currentUserCanBypass: The bypass type of the user making the API request for this ruleset. This field is only returned when - /// - nodeId: - /// - _links: - /// - conditions: - /// - rules: - /// - createdAt: - /// - updatedAt: + /// - _type: + /// - parameters: public init( - id: Swift.Int, - name: Swift.String, - target: Components.Schemas.RepositoryRuleset.TargetPayload? = nil, - sourceType: Components.Schemas.RepositoryRuleset.SourceTypePayload? = nil, - source: Swift.String, - enforcement: Components.Schemas.RepositoryRuleEnforcement, - bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, - currentUserCanBypass: Components.Schemas.RepositoryRuleset.CurrentUserCanBypassPayload? = nil, - nodeId: Swift.String? = nil, - _links: Components.Schemas.RepositoryRuleset._LinksPayload? = nil, - conditions: Components.Schemas.RepositoryRuleset.ConditionsPayload? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil, - createdAt: Foundation.Date? = nil, - updatedAt: Foundation.Date? = nil + _type: Components.Schemas.RepositoryRuleCommitMessagePattern._TypePayload, + parameters: Components.Schemas.RepositoryRuleCommitMessagePattern.ParametersPayload? = nil ) { - self.id = id - self.name = name - self.target = target - self.sourceType = sourceType - self.source = source - self.enforcement = enforcement - self.bypassActors = bypassActors - self.currentUserCanBypass = currentUserCanBypass - self.nodeId = nodeId - self._links = _links - self.conditions = conditions - self.rules = rules - self.createdAt = createdAt - self.updatedAt = updatedAt + self._type = _type + self.parameters = parameters } public enum CodingKeys: String, CodingKey { - case id - case name - case target - case sourceType = "source_type" - case source - case enforcement - case bypassActors = "bypass_actors" - case currentUserCanBypass = "current_user_can_bypass" - case nodeId = "node_id" - case _links - case conditions - case rules - case createdAt = "created_at" - case updatedAt = "updated_at" + case _type = "type" + case parameters } } - /// A repository rule. + /// Parameters to be used for the commit_author_email_pattern 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) + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern`. + public struct RepositoryRuleCommitAuthorEmailPattern: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case commitAuthorEmailPattern = "commit_author_email_pattern" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/type`. + public var _type: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// How this rule will appear to users. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/name`. + public var name: Swift.String? + /// If true, the rule will fail if the pattern matches. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/negate`. + public var negate: Swift.Bool? + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/operator`. + @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case startsWith = "starts_with" + case endsWith = "ends_with" + case contains = "contains" + case regex = "regex" } - do { - self = .RepositoryRuleFileExtensionRestriction(try .init(from: decoder)) - return - } catch { - errors.append(error) + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/operator`. + public var _operator: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload.OperatorPayload + /// The pattern to match with. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters/pattern`. + public var pattern: Swift.String + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - name: How this rule will appear to users. + /// - negate: If true, the rule will fail if the pattern matches. + /// - _operator: The operator to use for matching. + /// - pattern: The pattern to match with. + public init( + name: Swift.String? = nil, + negate: Swift.Bool? = nil, + _operator: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload.OperatorPayload, + pattern: Swift.String + ) { + self.name = name + self.negate = negate + self._operator = _operator + self.pattern = pattern } - do { - self = .RepositoryRuleMaxFileSize(try .init(from: decoder)) - return - } catch { - errors.append(error) + public enum CodingKeys: String, CodingKey { + case name + case negate + case _operator = "operator" + case pattern } - do { - self = .RepositoryRuleWorkflows(try .init(from: decoder)) - return - } catch { - errors.append(error) + } + /// - Remark: Generated from `#/components/schemas/repository-rule-commit-author-email-pattern/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload? + /// Creates a new `RepositoryRuleCommitAuthorEmailPattern`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern._TypePayload, + parameters: Components.Schemas.RepositoryRuleCommitAuthorEmailPattern.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Parameters to be used for the committer_email_pattern rule + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern`. + public struct RepositoryRuleCommitterEmailPattern: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case committerEmailPattern = "committer_email_pattern" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/type`. + public var _type: Components.Schemas.RepositoryRuleCommitterEmailPattern._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// How this rule will appear to users. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/name`. + public var name: Swift.String? + /// If true, the rule will fail if the pattern matches. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/negate`. + public var negate: Swift.Bool? + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/operator`. + @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case startsWith = "starts_with" + case endsWith = "ends_with" + case contains = "contains" + case regex = "regex" } - do { - self = .RepositoryRuleCodeScanning(try .init(from: decoder)) - return - } catch { - errors.append(error) + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/operator`. + public var _operator: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload.OperatorPayload + /// The pattern to match with. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters/pattern`. + public var pattern: Swift.String + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - name: How this rule will appear to users. + /// - negate: If true, the rule will fail if the pattern matches. + /// - _operator: The operator to use for matching. + /// - pattern: The pattern to match with. + public init( + name: Swift.String? = nil, + negate: Swift.Bool? = nil, + _operator: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload.OperatorPayload, + pattern: Swift.String + ) { + self.name = name + self.negate = negate + self._operator = _operator + self.pattern = pattern } - 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) + public enum CodingKeys: String, CodingKey { + case name + case negate + case _operator = "operator" + case pattern } } - } - /// - Remark: Generated from `#/components/schemas/RuleSuites`. - public struct RuleSuitesPayload: Codable, Hashable, Sendable { - /// The unique identifier of the rule insight. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/id`. - public var id: Swift.Int? - /// The number that identifies the user. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/actor_id`. - public var actorId: Swift.Int? - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/actor_name`. - public var actorName: Swift.String? - /// The first commit sha before the push evaluation. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/before_sha`. - public var beforeSha: Swift.String? - /// The last commit sha in the push evaluation. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/after_sha`. - public var afterSha: Swift.String? - /// The ref name that the evaluation ran on. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/ref`. - public var ref: Swift.String? - /// The ID of the repository associated with the rule evaluation. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/repository_id`. - public var repositoryId: Swift.Int? - /// The name of the repository without the `.git` extension. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/repository_name`. - public var repositoryName: Swift.String? - /// - Remark: Generated from `#/components/schemas/RuleSuites/pushed_at`. - public var pushedAt: Foundation.Date? - /// The result of the rule evaluations for rules with the `active` enforcement status. + /// - Remark: Generated from `#/components/schemas/repository-rule-committer-email-pattern/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload? + /// Creates a new `RepositoryRuleCommitterEmailPattern`. /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/result`. - @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pass = "pass" - case fail = "fail" - case bypass = "bypass" + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleCommitterEmailPattern._TypePayload, + parameters: Components.Schemas.RepositoryRuleCommitterEmailPattern.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters } - /// The result of the rule evaluations for rules with the `active` enforcement status. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/result`. - public var result: Components.Schemas.RuleSuitesPayload.ResultPayload? - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/evaluation_result`. - @frozen public enum EvaluationResultPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pass = "pass" - case fail = "fail" - case bypass = "bypass" + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters } - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. - /// - /// - Remark: Generated from `#/components/schemas/RuleSuites/evaluation_result`. - public var evaluationResult: Components.Schemas.RuleSuitesPayload.EvaluationResultPayload? - /// Creates a new `RuleSuitesPayload`. + } + /// Parameters to be used for the branch_name_pattern rule + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern`. + public struct RepositoryRuleBranchNamePattern: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case branchNamePattern = "branch_name_pattern" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/type`. + public var _type: Components.Schemas.RepositoryRuleBranchNamePattern._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// How this rule will appear to users. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/name`. + public var name: Swift.String? + /// If true, the rule will fail if the pattern matches. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/negate`. + public var negate: Swift.Bool? + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/operator`. + @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case startsWith = "starts_with" + case endsWith = "ends_with" + case contains = "contains" + case regex = "regex" + } + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/operator`. + public var _operator: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload.OperatorPayload + /// The pattern to match with. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters/pattern`. + public var pattern: Swift.String + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - name: How this rule will appear to users. + /// - negate: If true, the rule will fail if the pattern matches. + /// - _operator: The operator to use for matching. + /// - pattern: The pattern to match with. + public init( + name: Swift.String? = nil, + negate: Swift.Bool? = nil, + _operator: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload.OperatorPayload, + pattern: Swift.String + ) { + self.name = name + self.negate = negate + self._operator = _operator + self.pattern = pattern + } + public enum CodingKeys: String, CodingKey { + case name + case negate + case _operator = "operator" + case pattern + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-branch-name-pattern/parameters`. + public var parameters: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload? + /// Creates a new `RepositoryRuleBranchNamePattern`. /// /// - Parameters: - /// - id: The unique identifier of the rule insight. - /// - actorId: The number that identifies the user. - /// - actorName: The handle for the GitHub user account. - /// - beforeSha: The first commit sha before the push evaluation. - /// - afterSha: The last commit sha in the push evaluation. - /// - ref: The ref name that the evaluation ran on. - /// - repositoryId: The ID of the repository associated with the rule evaluation. - /// - repositoryName: The name of the repository without the `.git` extension. - /// - pushedAt: - /// - result: The result of the rule evaluations for rules with the `active` enforcement status. - /// - evaluationResult: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// - _type: + /// - parameters: public init( - id: Swift.Int? = nil, - actorId: Swift.Int? = nil, - actorName: Swift.String? = nil, - beforeSha: Swift.String? = nil, - afterSha: Swift.String? = nil, - ref: Swift.String? = nil, - repositoryId: Swift.Int? = nil, - repositoryName: Swift.String? = nil, - pushedAt: Foundation.Date? = nil, - result: Components.Schemas.RuleSuitesPayload.ResultPayload? = nil, - evaluationResult: Components.Schemas.RuleSuitesPayload.EvaluationResultPayload? = nil + _type: Components.Schemas.RepositoryRuleBranchNamePattern._TypePayload, + parameters: Components.Schemas.RepositoryRuleBranchNamePattern.ParametersPayload? = nil ) { - self.id = id - self.actorId = actorId - self.actorName = actorName - self.beforeSha = beforeSha - self.afterSha = afterSha - self.ref = ref - self.repositoryId = repositoryId - self.repositoryName = repositoryName - self.pushedAt = pushedAt - self.result = result - self.evaluationResult = evaluationResult + self._type = _type + self.parameters = parameters } public enum CodingKeys: String, CodingKey { - case id - case actorId = "actor_id" - case actorName = "actor_name" - case beforeSha = "before_sha" - case afterSha = "after_sha" - case ref - case repositoryId = "repository_id" - case repositoryName = "repository_name" - case pushedAt = "pushed_at" - case result - case evaluationResult = "evaluation_result" + case _type = "type" + case parameters } } - /// Response - /// - /// - Remark: Generated from `#/components/schemas/rule-suites`. - public typealias RuleSuites = [Components.Schemas.RuleSuitesPayload] - /// Response + /// Parameters to be used for the tag_name_pattern rule /// - /// - Remark: Generated from `#/components/schemas/rule-suite`. - public struct RuleSuite: Codable, Hashable, Sendable { - /// The unique identifier of the rule insight. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/id`. - public var id: Swift.Int? - /// The number that identifies the user. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/actor_id`. - public var actorId: Swift.Int? - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/actor_name`. - public var actorName: Swift.String? - /// The first commit sha before the push evaluation. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/before_sha`. - public var beforeSha: Swift.String? - /// The last commit sha in the push evaluation. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/after_sha`. - public var afterSha: Swift.String? - /// The ref name that the evaluation ran on. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/ref`. - public var ref: Swift.String? - /// The ID of the repository associated with the rule evaluation. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/repository_id`. - public var repositoryId: Swift.Int? - /// The name of the repository without the `.git` extension. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/repository_name`. - public var repositoryName: Swift.String? - /// - Remark: Generated from `#/components/schemas/rule-suite/pushed_at`. - public var pushedAt: Foundation.Date? - /// The result of the rule evaluations for rules with the `active` enforcement status. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/result`. - @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pass = "pass" - case fail = "fail" - case bypass = "bypass" + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern`. + public struct RepositoryRuleTagNamePattern: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case tagNamePattern = "tag_name_pattern" } - /// The result of the rule evaluations for rules with the `active` enforcement status. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/result`. - public var result: Components.Schemas.RuleSuite.ResultPayload? - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. - @frozen public enum EvaluationResultPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pass = "pass" - case fail = "fail" - case bypass = "bypass" + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/type`. + public var _type: Components.Schemas.RepositoryRuleTagNamePattern._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// How this rule will appear to users. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/name`. + public var name: Swift.String? + /// If true, the rule will fail if the pattern matches. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/negate`. + public var negate: Swift.Bool? + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/operator`. + @frozen public enum OperatorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case startsWith = "starts_with" + case endsWith = "ends_with" + case contains = "contains" + case regex = "regex" + } + /// The operator to use for matching. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/operator`. + public var _operator: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload.OperatorPayload + /// The pattern to match with. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters/pattern`. + public var pattern: Swift.String + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - name: How this rule will appear to users. + /// - negate: If true, the rule will fail if the pattern matches. + /// - _operator: The operator to use for matching. + /// - pattern: The pattern to match with. + public init( + name: Swift.String? = nil, + negate: Swift.Bool? = nil, + _operator: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload.OperatorPayload, + pattern: Swift.String + ) { + self.name = name + self.negate = negate + self._operator = _operator + self.pattern = pattern + } + public enum CodingKeys: String, CodingKey { + case name + case negate + case _operator = "operator" + case pattern + } } - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. + /// - Remark: Generated from `#/components/schemas/repository-rule-tag-name-pattern/parameters`. + public var parameters: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload? + /// Creates a new `RepositoryRuleTagNamePattern`. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. - public var evaluationResult: Components.Schemas.RuleSuite.EvaluationResultPayload? - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload`. - public struct RuleEvaluationsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source`. - public struct RuleSourcePayload: Codable, Hashable, Sendable { - /// The type of rule source. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/type`. - public var _type: Swift.String? - /// The ID of the rule source. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/id`. - public var id: Swift.Int? - /// The name of the rule source. - /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/name`. - public var name: Swift.String? - /// Creates a new `RuleSourcePayload`. - /// - /// - Parameters: - /// - _type: The type of rule source. - /// - id: The ID of the rule source. - /// - name: The name of the rule source. - public init( - _type: Swift.String? = nil, - id: Swift.Int? = nil, - name: Swift.String? = nil - ) { - self._type = _type - self.id = id - self.name = name - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case id - case name - } - } - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source`. - public var ruleSource: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.RuleSourcePayload? - /// The enforcement level of this rule source. + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleTagNamePattern._TypePayload, + parameters: Components.Schemas.RepositoryRuleTagNamePattern.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits that include changes in specified file and folder paths from being pushed to the commit graph. This includes absolute paths that contain file names. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction`. + public struct RepositoryRuleFilePathRestriction: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case filePathRestriction = "file_path_restriction" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. + public var _type: Components.Schemas.RepositoryRuleFilePathRestriction._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// The file paths that are restricted from being pushed to the commit graph. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/enforcement`. - @frozen public enum EnforcementPayload: String, Codable, Hashable, Sendable, CaseIterable { - case active = "active" - case evaluate = "evaluate" - case deletedRuleset = "deleted ruleset" + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters/restricted_file_paths`. + public var restrictedFilePaths: [Swift.String] + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - restrictedFilePaths: The file paths that are restricted from being pushed to the commit graph. + public init(restrictedFilePaths: [Swift.String]) { + self.restrictedFilePaths = restrictedFilePaths } - /// The enforcement level of this rule source. + public enum CodingKeys: String, CodingKey { + case restrictedFilePaths = "restricted_file_paths" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. + public var parameters: Components.Schemas.RepositoryRuleFilePathRestriction.ParametersPayload? + /// Creates a new `RepositoryRuleFilePathRestriction`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleFilePathRestriction._TypePayload, + parameters: Components.Schemas.RepositoryRuleFilePathRestriction.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits that include file paths that exceed the specified character limit from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length`. + public struct RepositoryRuleMaxFilePathLength: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case maxFilePathLength = "max_file_path_length" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. + public var _type: Components.Schemas.RepositoryRuleMaxFilePathLength._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// The maximum amount of characters allowed in file paths. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/enforcement`. - public var enforcement: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.EnforcementPayload? - /// The result of the evaluation of the individual rule. + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters/max_file_path_length`. + public var maxFilePathLength: Swift.Int + /// Creates a new `ParametersPayload`. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/result`. - @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { - case pass = "pass" - case fail = "fail" + /// - Parameters: + /// - maxFilePathLength: The maximum amount of characters allowed in file paths. + public init(maxFilePathLength: Swift.Int) { + self.maxFilePathLength = maxFilePathLength } - /// The result of the evaluation of the individual rule. + public enum CodingKeys: String, CodingKey { + case maxFilePathLength = "max_file_path_length" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. + public var parameters: Components.Schemas.RepositoryRuleMaxFilePathLength.ParametersPayload? + /// Creates a new `RepositoryRuleMaxFilePathLength`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleMaxFilePathLength._TypePayload, + parameters: Components.Schemas.RepositoryRuleMaxFilePathLength.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction`. + public struct RepositoryRuleFileExtensionRestriction: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case fileExtensionRestriction = "file_extension_restriction" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. + public var _type: Components.Schemas.RepositoryRuleFileExtensionRestriction._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// The file extensions that are restricted from being pushed to the commit graph. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/result`. - public var result: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.ResultPayload? - /// The type of rule. + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters/restricted_file_extensions`. + public var restrictedFileExtensions: [Swift.String] + /// Creates a new `ParametersPayload`. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_type`. - public var ruleType: Swift.String? - /// The detailed failure message for the rule. Null if the rule passed. + /// - Parameters: + /// - restrictedFileExtensions: The file extensions that are restricted from being pushed to the commit graph. + public init(restrictedFileExtensions: [Swift.String]) { + self.restrictedFileExtensions = restrictedFileExtensions + } + public enum CodingKeys: String, CodingKey { + case restrictedFileExtensions = "restricted_file_extensions" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. + public var parameters: Components.Schemas.RepositoryRuleFileExtensionRestriction.ParametersPayload? + /// Creates a new `RepositoryRuleFileExtensionRestriction`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleFileExtensionRestriction._TypePayload, + parameters: Components.Schemas.RepositoryRuleFileExtensionRestriction.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits with individual files that exceed the specified limit from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size`. + public struct RepositoryRuleMaxFileSize: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case maxFileSize = "max_file_size" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. + public var _type: Components.Schemas.RepositoryRuleMaxFileSize._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). /// - /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/details`. - public var details: Swift.String? - /// Creates a new `RuleEvaluationsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters/max_file_size`. + public var maxFileSize: Swift.Int + /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - ruleSource: - /// - enforcement: The enforcement level of this rule source. - /// - result: The result of the evaluation of the individual rule. - /// - ruleType: The type of rule. - /// - details: The detailed failure message for the rule. Null if the rule passed. - public init( - ruleSource: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.RuleSourcePayload? = nil, - enforcement: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.EnforcementPayload? = nil, - result: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.ResultPayload? = nil, - ruleType: Swift.String? = nil, - details: Swift.String? = nil - ) { - self.ruleSource = ruleSource - self.enforcement = enforcement - self.result = result - self.ruleType = ruleType - self.details = details + /// - maxFileSize: The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + public init(maxFileSize: Swift.Int) { + self.maxFileSize = maxFileSize } public enum CodingKeys: String, CodingKey { - case ruleSource = "rule_source" - case enforcement - case result - case ruleType = "rule_type" - case details + case maxFileSize = "max_file_size" } } - /// Details on the evaluated rules. + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. + public var parameters: Components.Schemas.RepositoryRuleMaxFileSize.ParametersPayload? + /// Creates a new `RepositoryRuleMaxFileSize`. /// - /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluations`. - public typealias RuleEvaluationsPayload = [Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload] - /// Details on the evaluated rules. + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleMaxFileSize._TypePayload, + parameters: Components.Schemas.RepositoryRuleMaxFileSize.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// A workflow that must run for this rule to pass + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference`. + public struct RepositoryRuleParamsWorkflowFileReference: Codable, Hashable, Sendable { + /// The path to the workflow file /// - /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluations`. - public var ruleEvaluations: Components.Schemas.RuleSuite.RuleEvaluationsPayload? - /// Creates a new `RuleSuite`. + /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/path`. + public var path: Swift.String + /// The ref (branch or tag) of the workflow file to use + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/ref`. + public var ref: Swift.String? + /// The ID of the repository where the workflow is defined + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/repository_id`. + public var repositoryId: Swift.Int + /// The commit SHA of the workflow file to use + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference/sha`. + public var sha: Swift.String? + /// Creates a new `RepositoryRuleParamsWorkflowFileReference`. /// /// - Parameters: - /// - id: The unique identifier of the rule insight. - /// - actorId: The number that identifies the user. - /// - actorName: The handle for the GitHub user account. - /// - beforeSha: The first commit sha before the push evaluation. - /// - afterSha: The last commit sha in the push evaluation. - /// - ref: The ref name that the evaluation ran on. - /// - repositoryId: The ID of the repository associated with the rule evaluation. - /// - repositoryName: The name of the repository without the `.git` extension. - /// - pushedAt: - /// - result: The result of the rule evaluations for rules with the `active` enforcement status. - /// - evaluationResult: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. - /// - ruleEvaluations: Details on the evaluated rules. + /// - path: The path to the workflow file + /// - ref: The ref (branch or tag) of the workflow file to use + /// - repositoryId: The ID of the repository where the workflow is defined + /// - sha: The commit SHA of the workflow file to use public init( - id: Swift.Int? = nil, - actorId: Swift.Int? = nil, - actorName: Swift.String? = nil, - beforeSha: Swift.String? = nil, - afterSha: Swift.String? = nil, + path: Swift.String, ref: Swift.String? = nil, - repositoryId: Swift.Int? = nil, - repositoryName: Swift.String? = nil, - pushedAt: Foundation.Date? = nil, - result: Components.Schemas.RuleSuite.ResultPayload? = nil, - evaluationResult: Components.Schemas.RuleSuite.EvaluationResultPayload? = nil, - ruleEvaluations: Components.Schemas.RuleSuite.RuleEvaluationsPayload? = nil + repositoryId: Swift.Int, + sha: Swift.String? = nil ) { - self.id = id - self.actorId = actorId - self.actorName = actorName - self.beforeSha = beforeSha - self.afterSha = afterSha + self.path = path self.ref = ref self.repositoryId = repositoryId - self.repositoryName = repositoryName - self.pushedAt = pushedAt - self.result = result - self.evaluationResult = evaluationResult - self.ruleEvaluations = ruleEvaluations + self.sha = sha } public enum CodingKeys: String, CodingKey { - case id - case actorId = "actor_id" - case actorName = "actor_name" - case beforeSha = "before_sha" - case afterSha = "after_sha" + case path case ref case repositoryId = "repository_id" - case repositoryName = "repository_name" - case pushedAt = "pushed_at" - case result - case evaluationResult = "evaluation_result" - case ruleEvaluations = "rule_evaluations" + case sha } } - /// The historical version of a ruleset + /// Require all changes made to a targeted branch to pass the specified workflows before they can be merged. /// - /// - Remark: Generated from `#/components/schemas/ruleset-version`. - public struct RulesetVersion: Codable, Hashable, Sendable { - /// The ID of the previous version of the ruleset - /// - /// - Remark: Generated from `#/components/schemas/ruleset-version/version_id`. - public var versionId: Swift.Int - /// The actor who updated the ruleset - /// - /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. - public struct ActorPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/type`. - public var _type: Swift.String? - /// Creates a new `ActorPayload`. + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows`. + public struct RepositoryRuleWorkflows: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case workflows = "workflows" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/type`. + public var _type: Components.Schemas.RepositoryRuleWorkflows._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Allow repositories and branches to be created if a check would otherwise prohibit it. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters/do_not_enforce_on_create`. + public var doNotEnforceOnCreate: Swift.Bool? + /// Workflows that must pass for this rule to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters/workflows`. + public var workflows: [Components.Schemas.RepositoryRuleParamsWorkflowFileReference] + /// Creates a new `ParametersPayload`. /// /// - Parameters: - /// - id: - /// - _type: + /// - doNotEnforceOnCreate: Allow repositories and branches to be created if a check would otherwise prohibit it. + /// - workflows: Workflows that must pass for this rule to pass. public init( - id: Swift.Int? = nil, - _type: Swift.String? = nil + doNotEnforceOnCreate: Swift.Bool? = nil, + workflows: [Components.Schemas.RepositoryRuleParamsWorkflowFileReference] ) { - self.id = id - self._type = _type + self.doNotEnforceOnCreate = doNotEnforceOnCreate + self.workflows = workflows } public enum CodingKeys: String, CodingKey { - case id - case _type = "type" + case doNotEnforceOnCreate = "do_not_enforce_on_create" + case workflows } } - /// The actor who updated the ruleset - /// - /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. - public var actor: Components.Schemas.RulesetVersion.ActorPayload - /// - Remark: Generated from `#/components/schemas/ruleset-version/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `RulesetVersion`. + /// - Remark: Generated from `#/components/schemas/repository-rule-workflows/parameters`. + public var parameters: Components.Schemas.RepositoryRuleWorkflows.ParametersPayload? + /// Creates a new `RepositoryRuleWorkflows`. /// /// - Parameters: - /// - versionId: The ID of the previous version of the ruleset - /// - actor: The actor who updated the ruleset - /// - updatedAt: + /// - _type: + /// - parameters: public init( - versionId: Swift.Int, - actor: Components.Schemas.RulesetVersion.ActorPayload, - updatedAt: Foundation.Date + _type: Components.Schemas.RepositoryRuleWorkflows._TypePayload, + parameters: Components.Schemas.RepositoryRuleWorkflows.ParametersPayload? = nil ) { - self.versionId = versionId - self.actor = actor - self.updatedAt = updatedAt + self._type = _type + self.parameters = parameters } public enum CodingKeys: String, CodingKey { - case versionId = "version_id" - case actor - case updatedAt = "updated_at" + case _type = "type" + case parameters } } - /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state`. - public struct RulesetVersionWithState: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value1`. - public var value1: Components.Schemas.RulesetVersion - /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. - public struct Value2Payload: Codable, Hashable, Sendable { - /// The state of the ruleset version - /// - /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2/state`. - public var state: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `Value2Payload`. - /// - /// - Parameters: - /// - state: The state of the ruleset version - public init(state: OpenAPIRuntime.OpenAPIObjectContainer) { - self.state = state - } - public enum CodingKeys: String, CodingKey { - case state - } + /// A tool that must provide code scanning results for this rule to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool`. + public struct RepositoryRuleParamsCodeScanningTool: Codable, Hashable, Sendable { + /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. + @frozen public enum AlertsThresholdPayload: String, Codable, Hashable, Sendable, CaseIterable { + case none = "none" + case errors = "errors" + case errorsAndWarnings = "errors_and_warnings" + case all = "all" } - /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. - public var value2: Components.Schemas.RulesetVersionWithState.Value2Payload - /// Creates a new `RulesetVersionWithState`. + /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. + public var alertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.AlertsThresholdPayload + /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. + @frozen public enum SecurityAlertsThresholdPayload: String, Codable, Hashable, Sendable, CaseIterable { + case none = "none" + case critical = "critical" + case highOrHigher = "high_or_higher" + case mediumOrHigher = "medium_or_higher" + case all = "all" + } + /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. + public var securityAlertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.SecurityAlertsThresholdPayload + /// The name of a code scanning tool + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/tool`. + public var tool: Swift.String + /// Creates a new `RepositoryRuleParamsCodeScanningTool`. /// /// - Parameters: - /// - value1: - /// - value2: + /// - alertsThreshold: The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// - securityAlertsThreshold: The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// - tool: The name of a code scanning tool public init( - value1: Components.Schemas.RulesetVersion, - value2: Components.Schemas.RulesetVersionWithState.Value2Payload + alertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.AlertsThresholdPayload, + securityAlertsThreshold: Components.Schemas.RepositoryRuleParamsCodeScanningTool.SecurityAlertsThresholdPayload, + tool: Swift.String ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - self.value1 = try .init(from: decoder) - self.value2 = try .init(from: decoder) + self.alertsThreshold = alertsThreshold + self.securityAlertsThreshold = securityAlertsThreshold + self.tool = tool } - public func encode(to encoder: any Encoder) throws { - try self.value1.encode(to: encoder) - try self.value2.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case alertsThreshold = "alerts_threshold" + case securityAlertsThreshold = "security_alerts_threshold" + case tool } } - /// The type of reviewer. - /// - /// - Remark: Generated from `#/components/schemas/deployment-reviewer-type`. - @frozen public enum DeploymentReviewerType: String, Codable, Hashable, Sendable, CaseIterable { - case user = "User" - case team = "Team" - } - /// A request for a specific ref(branch,sha,tag) to be deployed - /// - /// - Remark: Generated from `#/components/schemas/deployment`. - public struct Deployment: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/deployment/url`. - public var url: Swift.String - /// Unique identifier of the deployment - /// - /// - Remark: Generated from `#/components/schemas/deployment/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/deployment/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/deployment/sha`. - public var sha: Swift.String - /// The ref to deploy. This can be a branch, tag, or sha. - /// - /// - Remark: Generated from `#/components/schemas/deployment/ref`. - public var ref: Swift.String - /// Parameter to specify a task to execute - /// - /// - Remark: Generated from `#/components/schemas/deployment/task`. - public var task: Swift.String - /// - Remark: Generated from `#/components/schemas/deployment/payload`. - @frozen public enum PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/deployment/payload/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/components/schemas/deployment/payload/case1`. - case case1(Components.Schemas.Deployment.PayloadPayload.Case1Payload) - /// - Remark: Generated from `#/components/schemas/deployment/payload/case2`. - case case2(Swift.String) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning`. + public struct RepositoryRuleCodeScanning: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case codeScanning = "code_scanning" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. + public var _type: Components.Schemas.RepositoryRuleCodeScanning._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Tools that must provide code scanning results for this rule to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters/code_scanning_tools`. + public var codeScanningTools: [Components.Schemas.RepositoryRuleParamsCodeScanningTool] + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - codeScanningTools: Tools that must provide code scanning results for this rule to pass. + public init(codeScanningTools: [Components.Schemas.RepositoryRuleParamsCodeScanningTool]) { + self.codeScanningTools = codeScanningTools } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case codeScanningTools = "code_scanning_tools" } } - /// - Remark: Generated from `#/components/schemas/deployment/payload`. - public var payload: Components.Schemas.Deployment.PayloadPayload - /// - Remark: Generated from `#/components/schemas/deployment/original_environment`. - public var originalEnvironment: Swift.String? - /// Name for the target deployment environment. - /// - /// - Remark: Generated from `#/components/schemas/deployment/environment`. - public var environment: Swift.String - /// - Remark: Generated from `#/components/schemas/deployment/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/deployment/creator`. - public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/deployment/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/deployment/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/deployment/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/deployment/repository_url`. - public var repositoryUrl: Swift.String - /// Specifies if the given environment is will no longer exist at some point in the future. Default: false. - /// - /// - Remark: Generated from `#/components/schemas/deployment/transient_environment`. - public var transientEnvironment: Swift.Bool? - /// Specifies if the given environment is one that end-users directly interact with. Default: false. - /// - /// - Remark: Generated from `#/components/schemas/deployment/production_environment`. - public var productionEnvironment: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/deployment/performed_via_github_app`. - public var performedViaGithubApp: Components.Schemas.NullableIntegration? - /// Creates a new `Deployment`. + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCodeScanning.ParametersPayload? + /// Creates a new `RepositoryRuleCodeScanning`. /// /// - Parameters: - /// - url: - /// - id: Unique identifier of the deployment - /// - nodeId: - /// - sha: - /// - ref: The ref to deploy. This can be a branch, tag, or sha. - /// - task: Parameter to specify a task to execute - /// - payload: - /// - originalEnvironment: - /// - environment: Name for the target deployment environment. - /// - description: - /// - creator: - /// - createdAt: - /// - updatedAt: - /// - statusesUrl: - /// - repositoryUrl: - /// - transientEnvironment: Specifies if the given environment is will no longer exist at some point in the future. Default: false. - /// - productionEnvironment: Specifies if the given environment is one that end-users directly interact with. Default: false. - /// - performedViaGithubApp: + /// - _type: + /// - parameters: public init( - url: Swift.String, - id: Swift.Int64, - nodeId: Swift.String, - sha: Swift.String, - ref: Swift.String, - task: Swift.String, - payload: Components.Schemas.Deployment.PayloadPayload, - originalEnvironment: Swift.String? = nil, - environment: Swift.String, - description: Swift.String? = nil, - creator: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - statusesUrl: Swift.String, - repositoryUrl: Swift.String, - transientEnvironment: Swift.Bool? = nil, - productionEnvironment: Swift.Bool? = nil, - performedViaGithubApp: Components.Schemas.NullableIntegration? = nil + _type: Components.Schemas.RepositoryRuleCodeScanning._TypePayload, + parameters: Components.Schemas.RepositoryRuleCodeScanning.ParametersPayload? = nil ) { - self.url = url - self.id = id - self.nodeId = nodeId - self.sha = sha - self.ref = ref - self.task = task - self.payload = payload - self.originalEnvironment = originalEnvironment - self.environment = environment - self.description = description - self.creator = creator - self.createdAt = createdAt - self.updatedAt = updatedAt - self.statusesUrl = statusesUrl - self.repositoryUrl = repositoryUrl - self.transientEnvironment = transientEnvironment - self.productionEnvironment = productionEnvironment - self.performedViaGithubApp = performedViaGithubApp + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// A repository rule. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule`. + @frozen public enum RepositoryRule: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule/case1`. + case RepositoryRuleCreation(Components.Schemas.RepositoryRuleCreation) + /// - Remark: Generated from `#/components/schemas/repository-rule/case2`. + case RepositoryRuleUpdate(Components.Schemas.RepositoryRuleUpdate) + /// - Remark: Generated from `#/components/schemas/repository-rule/case3`. + case RepositoryRuleDeletion(Components.Schemas.RepositoryRuleDeletion) + /// - Remark: Generated from `#/components/schemas/repository-rule/case4`. + case RepositoryRuleRequiredLinearHistory(Components.Schemas.RepositoryRuleRequiredLinearHistory) + /// - Remark: Generated from `#/components/schemas/repository-rule/case5`. + case RepositoryRuleMergeQueue(Components.Schemas.RepositoryRuleMergeQueue) + /// - Remark: Generated from `#/components/schemas/repository-rule/case6`. + case RepositoryRuleRequiredDeployments(Components.Schemas.RepositoryRuleRequiredDeployments) + /// - Remark: Generated from `#/components/schemas/repository-rule/case7`. + case RepositoryRuleRequiredSignatures(Components.Schemas.RepositoryRuleRequiredSignatures) + /// - Remark: Generated from `#/components/schemas/repository-rule/case8`. + case RepositoryRulePullRequest(Components.Schemas.RepositoryRulePullRequest) + /// - Remark: Generated from `#/components/schemas/repository-rule/case9`. + case RepositoryRuleRequiredStatusChecks(Components.Schemas.RepositoryRuleRequiredStatusChecks) + /// - Remark: Generated from `#/components/schemas/repository-rule/case10`. + case RepositoryRuleNonFastForward(Components.Schemas.RepositoryRuleNonFastForward) + /// - Remark: Generated from `#/components/schemas/repository-rule/case11`. + case RepositoryRuleCommitMessagePattern(Components.Schemas.RepositoryRuleCommitMessagePattern) + /// - Remark: Generated from `#/components/schemas/repository-rule/case12`. + case RepositoryRuleCommitAuthorEmailPattern(Components.Schemas.RepositoryRuleCommitAuthorEmailPattern) + /// - Remark: Generated from `#/components/schemas/repository-rule/case13`. + case RepositoryRuleCommitterEmailPattern(Components.Schemas.RepositoryRuleCommitterEmailPattern) + /// - Remark: Generated from `#/components/schemas/repository-rule/case14`. + case RepositoryRuleBranchNamePattern(Components.Schemas.RepositoryRuleBranchNamePattern) + /// - Remark: Generated from `#/components/schemas/repository-rule/case15`. + case RepositoryRuleTagNamePattern(Components.Schemas.RepositoryRuleTagNamePattern) + /// - Remark: Generated from `#/components/schemas/repository-rule/case16`. + case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) + /// - Remark: Generated from `#/components/schemas/repository-rule/case17`. + case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) + /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. + case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. + case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) + /// - Remark: Generated from `#/components/schemas/repository-rule/case20`. + case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) + /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. + 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 = .RepositoryRuleMergeQueue(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 enum CodingKeys: String, CodingKey { - case url - case id - case nodeId = "node_id" - case sha - case ref - case task - case payload - case originalEnvironment = "original_environment" - case environment - case description - case creator - case createdAt = "created_at" - case updatedAt = "updated_at" - case statusesUrl = "statuses_url" - case repositoryUrl = "repository_url" - case transientEnvironment = "transient_environment" - case productionEnvironment = "production_environment" - case performedViaGithubApp = "performed_via_github_app" + 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 .RepositoryRuleMergeQueue(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) + } } } - /// Activity + /// A set of rules to apply when specified conditions are met. /// - /// - Remark: Generated from `#/components/schemas/activity`. - public struct Activity: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/activity/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/activity/node_id`. - public var nodeId: Swift.String - /// The SHA of the commit before the activity. - /// - /// - Remark: Generated from `#/components/schemas/activity/before`. - public var before: Swift.String - /// The SHA of the commit after the activity. - /// - /// - Remark: Generated from `#/components/schemas/activity/after`. - public var after: Swift.String - /// The full Git reference, formatted as `refs/heads/`. - /// - /// - Remark: Generated from `#/components/schemas/activity/ref`. - public var ref: Swift.String - /// The time when the activity occurred. - /// - /// - Remark: Generated from `#/components/schemas/activity/timestamp`. - public var timestamp: Foundation.Date - /// The type of the activity that was performed. - /// - /// - Remark: Generated from `#/components/schemas/activity/activity_type`. - @frozen public enum ActivityTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case push = "push" - case forcePush = "force_push" - case branchDeletion = "branch_deletion" - case branchCreation = "branch_creation" - case prMerge = "pr_merge" - case mergeQueueMerge = "merge_queue_merge" - } - /// The type of the activity that was performed. - /// - /// - Remark: Generated from `#/components/schemas/activity/activity_type`. - public var activityType: Components.Schemas.Activity.ActivityTypePayload - /// - Remark: Generated from `#/components/schemas/activity/actor`. - public var actor: Components.Schemas.NullableSimpleUser? - /// Creates a new `Activity`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset`. + public struct RepositoryRuleset: Codable, Hashable, Sendable { + /// The ID of the ruleset /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - before: The SHA of the commit before the activity. - /// - after: The SHA of the commit after the activity. - /// - ref: The full Git reference, formatted as `refs/heads/`. - /// - timestamp: The time when the activity occurred. - /// - activityType: The type of the activity that was performed. - /// - actor: - public init( - id: Swift.Int, - nodeId: Swift.String, - before: Swift.String, - after: Swift.String, - ref: Swift.String, - timestamp: Foundation.Date, - activityType: Components.Schemas.Activity.ActivityTypePayload, - actor: Components.Schemas.NullableSimpleUser? = nil - ) { - self.id = id - self.nodeId = nodeId - self.before = before - self.after = after - self.ref = ref - self.timestamp = timestamp - self.activityType = activityType - self.actor = actor - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case before - case after - case ref - case timestamp - case activityType = "activity_type" - case actor - } - } - /// An autolink reference. - /// - /// - Remark: Generated from `#/components/schemas/autolink`. - public struct Autolink: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/autolink/id`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset/id`. public var id: Swift.Int - /// The prefix of a key that is linkified. - /// - /// - Remark: Generated from `#/components/schemas/autolink/key_prefix`. - public var keyPrefix: Swift.String - /// A template for the target URL that is generated if a key was found. - /// - /// - Remark: Generated from `#/components/schemas/autolink/url_template`. - public var urlTemplate: Swift.String - /// Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. - /// - /// - Remark: Generated from `#/components/schemas/autolink/is_alphanumeric`. - public var isAlphanumeric: Swift.Bool - /// - Remark: Generated from `#/components/schemas/autolink/updated_at`. - public var updatedAt: Foundation.Date? - /// Creates a new `Autolink`. + /// The name of the ruleset /// - /// - Parameters: - /// - id: - /// - keyPrefix: The prefix of a key that is linkified. - /// - urlTemplate: A template for the target URL that is generated if a key was found. - /// - isAlphanumeric: Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. - /// - updatedAt: - public init( - id: Swift.Int, - keyPrefix: Swift.String, - urlTemplate: Swift.String, - isAlphanumeric: Swift.Bool, - updatedAt: Foundation.Date? = nil - ) { - self.id = id - self.keyPrefix = keyPrefix - self.urlTemplate = urlTemplate - self.isAlphanumeric = isAlphanumeric - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case id - case keyPrefix = "key_prefix" - case urlTemplate = "url_template" - case isAlphanumeric = "is_alphanumeric" - case updatedAt = "updated_at" - } - } - /// Check Dependabot security updates - /// - /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes`. - public struct CheckAutomatedSecurityFixes: Codable, Hashable, Sendable { - /// Whether Dependabot security updates are enabled for the repository. + /// - Remark: Generated from `#/components/schemas/repository-ruleset/name`. + public var name: Swift.String + /// The target of the ruleset /// - /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/enabled`. - public var enabled: Swift.Bool - /// Whether Dependabot security updates are paused for the repository. + /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. + @frozen public enum TargetPayload: String, Codable, Hashable, Sendable, CaseIterable { + case branch = "branch" + case tag = "tag" + case push = "push" + case repository = "repository" + } + /// The target of the ruleset /// - /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/paused`. - public var paused: Swift.Bool - /// Creates a new `CheckAutomatedSecurityFixes`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. + public var target: Components.Schemas.RepositoryRuleset.TargetPayload? + /// The type of the source of the ruleset /// - /// - Parameters: - /// - enabled: Whether Dependabot security updates are enabled for the repository. - /// - paused: Whether Dependabot security updates are paused for the repository. - public init( - enabled: Swift.Bool, - paused: Swift.Bool - ) { - self.enabled = enabled - self.paused = paused + /// - Remark: Generated from `#/components/schemas/repository-ruleset/source_type`. + @frozen public enum SourceTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case repository = "Repository" + case organization = "Organization" + case enterprise = "Enterprise" } - public enum CodingKeys: String, CodingKey { - case enabled - case paused + /// The type of the source of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/source_type`. + public var sourceType: Components.Schemas.RepositoryRuleset.SourceTypePayload? + /// The name of the source + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/source`. + public var source: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-ruleset/enforcement`. + public var enforcement: Components.Schemas.RepositoryRuleEnforcement + /// The actors that can bypass the rules in this ruleset + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/bypass_actors`. + public var bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? + /// The bypass type of the user making the API request for this ruleset. This field is only returned when + /// querying the repository-level endpoint. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/current_user_can_bypass`. + @frozen public enum CurrentUserCanBypassPayload: String, Codable, Hashable, Sendable, CaseIterable { + case always = "always" + case pullRequestsOnly = "pull_requests_only" + case never = "never" + case exempt = "exempt" } - } - /// Protected Branch Required Status Check - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check`. - public struct ProtectedBranchRequiredStatusCheck: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/enforcement_level`. - public var enforcementLevel: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/contexts`. - public var contexts: [Swift.String] - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload`. - public struct ChecksPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload/context`. - public var context: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload/app_id`. - public var appId: Swift.Int? - /// Creates a new `ChecksPayloadPayload`. + /// The bypass type of the user making the API request for this ruleset. This field is only returned when + /// querying the repository-level endpoint. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/current_user_can_bypass`. + public var currentUserCanBypass: Components.Schemas.RepositoryRuleset.CurrentUserCanBypassPayload? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self`. + public struct _SelfPayload: Codable, Hashable, Sendable { + /// The URL of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self/href`. + public var href: Swift.String? + /// Creates a new `_SelfPayload`. + /// + /// - Parameters: + /// - href: The URL of the ruleset + public init(href: Swift.String? = nil) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/self`. + public var _self: Components.Schemas.RepositoryRuleset._LinksPayload._SelfPayload? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html`. + public struct HtmlPayload: Codable, Hashable, Sendable { + /// The html URL of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html/href`. + public var href: Swift.String? + /// Creates a new `HtmlPayload`. + /// + /// - Parameters: + /// - href: The html URL of the ruleset + public init(href: Swift.String? = nil) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links/html`. + public var html: Components.Schemas.RepositoryRuleset._LinksPayload.HtmlPayload? + /// Creates a new `_LinksPayload`. /// /// - Parameters: - /// - context: - /// - appId: + /// - _self: + /// - html: public init( - context: Swift.String, - appId: Swift.Int? = nil + _self: Components.Schemas.RepositoryRuleset._LinksPayload._SelfPayload? = nil, + html: Components.Schemas.RepositoryRuleset._LinksPayload.HtmlPayload? = nil ) { - self.context = context - self.appId = appId + self._self = _self + self.html = html } public enum CodingKeys: String, CodingKey { - case context - case appId = "app_id" + case _self = "self" + case html } } - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/checks`. - public typealias ChecksPayload = [Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayloadPayload] - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/checks`. - public var checks: Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayload - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/contexts_url`. - public var contextsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/strict`. - public var strict: Swift.Bool? - /// Creates a new `ProtectedBranchRequiredStatusCheck`. - /// - /// - Parameters: - /// - url: - /// - enforcementLevel: - /// - contexts: - /// - checks: - /// - contextsUrl: - /// - strict: - public init( - url: Swift.String? = nil, - enforcementLevel: Swift.String? = nil, - contexts: [Swift.String], - checks: Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayload, - contextsUrl: Swift.String? = nil, - strict: Swift.Bool? = nil - ) { - self.url = url - self.enforcementLevel = enforcementLevel - self.contexts = contexts - self.checks = checks - self.contextsUrl = contextsUrl - self.strict = strict - } - public enum CodingKeys: String, CodingKey { - case url - case enforcementLevel = "enforcement_level" - case contexts - case checks - case contextsUrl = "contexts_url" - case strict + /// - Remark: Generated from `#/components/schemas/repository-ruleset/_links`. + public var _links: Components.Schemas.RepositoryRuleset._LinksPayload? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions`. + public struct ConditionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions/value1`. + public var value1: Components.Schemas.RepositoryRulesetConditions? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions/value2`. + public var value2: Components.Schemas.OrgRulesetConditions? + /// Creates a new `ConditionsPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRulesetConditions? = nil, + value2: Components.Schemas.OrgRulesetConditions? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + } } - } - /// Protected Branch Admin Enforced - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced`. - public struct ProtectedBranchAdminEnforced: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced/enabled`. - public var enabled: Swift.Bool - /// Creates a new `ProtectedBranchAdminEnforced`. + /// - Remark: Generated from `#/components/schemas/repository-ruleset/conditions`. + public var conditions: Components.Schemas.RepositoryRuleset.ConditionsPayload? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/rules`. + public var rules: [Components.Schemas.RepositoryRule]? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository-ruleset/updated_at`. + public var updatedAt: Foundation.Date? + /// Creates a new `RepositoryRuleset`. /// /// - Parameters: - /// - url: - /// - enabled: + /// - id: The ID of the ruleset + /// - name: The name of the ruleset + /// - target: The target of the ruleset + /// - sourceType: The type of the source of the ruleset + /// - source: The name of the source + /// - enforcement: + /// - bypassActors: The actors that can bypass the rules in this ruleset + /// - currentUserCanBypass: The bypass type of the user making the API request for this ruleset. This field is only returned when + /// - nodeId: + /// - _links: + /// - conditions: + /// - rules: + /// - createdAt: + /// - updatedAt: public init( - url: Swift.String, - enabled: Swift.Bool + id: Swift.Int, + name: Swift.String, + target: Components.Schemas.RepositoryRuleset.TargetPayload? = nil, + sourceType: Components.Schemas.RepositoryRuleset.SourceTypePayload? = nil, + source: Swift.String, + enforcement: Components.Schemas.RepositoryRuleEnforcement, + bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, + currentUserCanBypass: Components.Schemas.RepositoryRuleset.CurrentUserCanBypassPayload? = nil, + nodeId: Swift.String? = nil, + _links: Components.Schemas.RepositoryRuleset._LinksPayload? = nil, + conditions: Components.Schemas.RepositoryRuleset.ConditionsPayload? = nil, + rules: [Components.Schemas.RepositoryRule]? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil ) { - self.url = url - self.enabled = enabled + self.id = id + self.name = name + self.target = target + self.sourceType = sourceType + self.source = source + self.enforcement = enforcement + self.bypassActors = bypassActors + self.currentUserCanBypass = currentUserCanBypass + self.nodeId = nodeId + self._links = _links + self.conditions = conditions + self.rules = rules + self.createdAt = createdAt + self.updatedAt = updatedAt } public enum CodingKeys: String, CodingKey { - case url - case enabled + case id + case name + case target + case sourceType = "source_type" + case source + case enforcement + case bypassActors = "bypass_actors" + case currentUserCanBypass = "current_user_can_bypass" + case nodeId = "node_id" + case _links + case conditions + case rules + case createdAt = "created_at" + case updatedAt = "updated_at" } } - /// Protected Branch Pull Request Review + /// A repository rule. /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review`. - public struct ProtectedBranchPullRequestReview: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions`. - public struct DismissalRestrictionsPayload: Codable, Hashable, Sendable { - /// The list of users with review dismissal access. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/users`. - public var users: [Components.Schemas.SimpleUser]? - /// The list of teams with review dismissal access. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/teams`. - public var teams: [Components.Schemas.Team]? - /// The list of apps with review dismissal access. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/apps`. - public var apps: [Components.Schemas.Integration]? - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/users_url`. - public var usersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/teams_url`. - public var teamsUrl: Swift.String? - /// Creates a new `DismissalRestrictionsPayload`. - /// - /// - Parameters: - /// - users: The list of users with review dismissal access. - /// - teams: The list of teams with review dismissal access. - /// - apps: The list of apps with review dismissal access. - /// - url: - /// - usersUrl: - /// - teamsUrl: - public init( - users: [Components.Schemas.SimpleUser]? = nil, - teams: [Components.Schemas.Team]? = nil, - apps: [Components.Schemas.Integration]? = nil, - url: Swift.String? = nil, - usersUrl: Swift.String? = nil, - teamsUrl: Swift.String? = nil - ) { - self.users = users - self.teams = teams - self.apps = apps - self.url = url - self.usersUrl = usersUrl - self.teamsUrl = teamsUrl + /// - 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) } - public enum CodingKeys: String, CodingKey { - case users - case teams - case apps - case url - case usersUrl = "users_url" - case teamsUrl = "teams_url" + do { + self = .RepositoryRuleUpdate(try .init(from: decoder)) + return + } catch { + errors.append(error) } - } - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions`. - public var dismissalRestrictions: Components.Schemas.ProtectedBranchPullRequestReview.DismissalRestrictionsPayload? - /// Allow specific users, teams, or apps to bypass pull request requirements. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances`. - public struct BypassPullRequestAllowancesPayload: Codable, Hashable, Sendable { - /// The list of users allowed to bypass pull request requirements. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/users`. - public var users: [Components.Schemas.SimpleUser]? - /// The list of teams allowed to bypass pull request requirements. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/teams`. - public var teams: [Components.Schemas.Team]? - /// The list of apps allowed to bypass pull request requirements. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/apps`. - public var apps: [Components.Schemas.Integration]? - /// Creates a new `BypassPullRequestAllowancesPayload`. - /// - /// - Parameters: - /// - users: The list of users allowed to bypass pull request requirements. - /// - teams: The list of teams allowed to bypass pull request requirements. - /// - apps: The list of apps allowed to bypass pull request requirements. - public init( - users: [Components.Schemas.SimpleUser]? = nil, - teams: [Components.Schemas.Team]? = nil, - apps: [Components.Schemas.Integration]? = nil - ) { - self.users = users - self.teams = teams - self.apps = apps + 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) } - public enum CodingKeys: String, CodingKey { - case users - case teams - case apps + do { + self = .RepositoryRuleTagNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) } - } - /// Allow specific users, teams, or apps to bypass pull request requirements. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances`. - public var bypassPullRequestAllowances: Components.Schemas.ProtectedBranchPullRequestReview.BypassPullRequestAllowancesPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismiss_stale_reviews`. - public var dismissStaleReviews: Swift.Bool - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/require_code_owner_reviews`. - public var requireCodeOwnerReviews: Swift.Bool - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/required_approving_review_count`. - public var requiredApprovingReviewCount: Swift.Int? - /// Whether the most recent push must be approved by someone other than the person who pushed it. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/require_last_push_approval`. - public var requireLastPushApproval: Swift.Bool? - /// Creates a new `ProtectedBranchPullRequestReview`. - /// - /// - Parameters: - /// - url: - /// - dismissalRestrictions: - /// - bypassPullRequestAllowances: Allow specific users, teams, or apps to bypass pull request requirements. - /// - dismissStaleReviews: - /// - requireCodeOwnerReviews: - /// - requiredApprovingReviewCount: - /// - requireLastPushApproval: Whether the most recent push must be approved by someone other than the person who pushed it. - public init( - url: Swift.String? = nil, - dismissalRestrictions: Components.Schemas.ProtectedBranchPullRequestReview.DismissalRestrictionsPayload? = nil, - bypassPullRequestAllowances: Components.Schemas.ProtectedBranchPullRequestReview.BypassPullRequestAllowancesPayload? = nil, - dismissStaleReviews: Swift.Bool, - requireCodeOwnerReviews: Swift.Bool, - requiredApprovingReviewCount: Swift.Int? = nil, - requireLastPushApproval: Swift.Bool? = nil - ) { - self.url = url - self.dismissalRestrictions = dismissalRestrictions - self.bypassPullRequestAllowances = bypassPullRequestAllowances - self.dismissStaleReviews = dismissStaleReviews - self.requireCodeOwnerReviews = requireCodeOwnerReviews - self.requiredApprovingReviewCount = requiredApprovingReviewCount - self.requireLastPushApproval = requireLastPushApproval - } - public enum CodingKeys: String, CodingKey { - case url - case dismissalRestrictions = "dismissal_restrictions" - case bypassPullRequestAllowances = "bypass_pull_request_allowances" - case dismissStaleReviews = "dismiss_stale_reviews" - case requireCodeOwnerReviews = "require_code_owner_reviews" - case requiredApprovingReviewCount = "required_approving_review_count" - case requireLastPushApproval = "require_last_push_approval" - } - } - /// Branch Restriction Policy - /// - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy`. - public struct BranchRestrictionPolicy: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users_url`. - public var usersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams_url`. - public var teamsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps_url`. - public var appsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload`. - public struct UsersPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/login`. - public var login: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/id`. - public var id: Swift.Int64? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/avatar_url`. - public var avatarUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/gravatar_id`. - public var gravatarId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/html_url`. - public var htmlUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/followers_url`. - public var followersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/following_url`. - public var followingUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/gists_url`. - public var gistsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/starred_url`. - public var starredUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/subscriptions_url`. - public var subscriptionsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/organizations_url`. - public var organizationsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/repos_url`. - public var reposUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/events_url`. - public var eventsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/received_events_url`. - public var receivedEventsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/type`. - public var _type: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/site_admin`. - public var siteAdmin: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `UsersPayloadPayload`. - /// - /// - Parameters: - /// - login: - /// - id: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: - /// - url: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - reposUrl: - /// - eventsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - userViewType: - public init( - login: Swift.String? = nil, - id: Swift.Int64? = nil, - nodeId: Swift.String? = nil, - avatarUrl: Swift.String? = nil, - gravatarId: Swift.String? = nil, - url: Swift.String? = nil, - htmlUrl: Swift.String? = nil, - followersUrl: Swift.String? = nil, - followingUrl: Swift.String? = nil, - gistsUrl: Swift.String? = nil, - starredUrl: Swift.String? = nil, - subscriptionsUrl: Swift.String? = nil, - organizationsUrl: Swift.String? = nil, - reposUrl: Swift.String? = nil, - eventsUrl: Swift.String? = nil, - receivedEventsUrl: Swift.String? = nil, - _type: Swift.String? = nil, - siteAdmin: Swift.Bool? = nil, - userViewType: Swift.String? = nil - ) { - 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.userViewType = userViewType + do { + self = .RepositoryRuleFilePathRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) } - public enum CodingKeys: String, CodingKey { - 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 userViewType = "user_view_type" + do { + self = .RepositoryRuleMaxFilePathLength(try .init(from: decoder)) + return + } catch { + errors.append(error) } - } - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. - public typealias UsersPayload = [Components.Schemas.BranchRestrictionPolicy.UsersPayloadPayload] - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. - public var users: Components.Schemas.BranchRestrictionPolicy.UsersPayload - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload`. - public struct TeamsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/html_url`. - public var htmlUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/slug`. - public var slug: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/permission`. - public var permission: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/members_url`. - public var membersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/repositories_url`. - public var repositoriesUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/parent`. - public var parent: Swift.String? - /// Creates a new `TeamsPayloadPayload`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - htmlUrl: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notificationSetting: - /// - permission: - /// - membersUrl: - /// - repositoriesUrl: - /// - parent: - public init( - id: Swift.Int? = nil, - nodeId: Swift.String? = nil, - url: Swift.String? = nil, - htmlUrl: Swift.String? = nil, - name: Swift.String? = nil, - slug: Swift.String? = nil, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - permission: Swift.String? = nil, - membersUrl: Swift.String? = nil, - repositoriesUrl: Swift.String? = nil, - parent: Swift.String? = nil - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.htmlUrl = htmlUrl - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notificationSetting = notificationSetting - self.permission = permission - self.membersUrl = membersUrl - self.repositoriesUrl = repositoriesUrl - self.parent = parent + do { + self = .RepositoryRuleFileExtensionRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFileSize(try .init(from: decoder)) + return + } catch { + errors.append(error) } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case htmlUrl = "html_url" - case name - case slug - case description - case privacy - case notificationSetting = "notification_setting" - case permission - case membersUrl = "members_url" - case repositoriesUrl = "repositories_url" - case parent + 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 + ) } - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams`. - public typealias TeamsPayload = [Components.Schemas.BranchRestrictionPolicy.TeamsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams`. - public var teams: Components.Schemas.BranchRestrictionPolicy.TeamsPayload - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload`. - public struct AppsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/slug`. - public var slug: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner`. - public struct OwnerPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/login`. - public var login: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/repos_url`. - public var reposUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/events_url`. - public var eventsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/hooks_url`. - public var hooksUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/issues_url`. - public var issuesUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/members_url`. - public var membersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/public_members_url`. - public var publicMembersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/avatar_url`. - public var avatarUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/gravatar_id`. - public var gravatarId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/html_url`. - public var htmlUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/followers_url`. - public var followersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/following_url`. - public var followingUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/gists_url`. - public var gistsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/starred_url`. - public var starredUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/subscriptions_url`. - public var subscriptionsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/organizations_url`. - public var organizationsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/received_events_url`. - public var receivedEventsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/type`. + 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. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/id`. + public var id: Swift.Int? + /// The number that identifies the user. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/actor_id`. + public var actorId: Swift.Int? + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/actor_name`. + public var actorName: Swift.String? + /// The first commit sha before the push evaluation. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/before_sha`. + public var beforeSha: Swift.String? + /// The last commit sha in the push evaluation. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/after_sha`. + public var afterSha: Swift.String? + /// The ref name that the evaluation ran on. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/ref`. + public var ref: Swift.String? + /// The ID of the repository associated with the rule evaluation. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/repository_id`. + public var repositoryId: Swift.Int? + /// The name of the repository without the `.git` extension. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/repository_name`. + public var repositoryName: Swift.String? + /// - Remark: Generated from `#/components/schemas/RuleSuites/pushed_at`. + public var pushedAt: Foundation.Date? + /// The result of the rule evaluations for rules with the `active` enforcement status. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/result`. + @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pass = "pass" + case fail = "fail" + case bypass = "bypass" + } + /// The result of the rule evaluations for rules with the `active` enforcement status. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/result`. + public var result: Components.Schemas.RuleSuitesPayload.ResultPayload? + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/evaluation_result`. + @frozen public enum EvaluationResultPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pass = "pass" + case fail = "fail" + case bypass = "bypass" + } + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// + /// - Remark: Generated from `#/components/schemas/RuleSuites/evaluation_result`. + public var evaluationResult: Components.Schemas.RuleSuitesPayload.EvaluationResultPayload? + /// Creates a new `RuleSuitesPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the rule insight. + /// - actorId: The number that identifies the user. + /// - actorName: The handle for the GitHub user account. + /// - beforeSha: The first commit sha before the push evaluation. + /// - afterSha: The last commit sha in the push evaluation. + /// - ref: The ref name that the evaluation ran on. + /// - repositoryId: The ID of the repository associated with the rule evaluation. + /// - repositoryName: The name of the repository without the `.git` extension. + /// - pushedAt: + /// - result: The result of the rule evaluations for rules with the `active` enforcement status. + /// - evaluationResult: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + public init( + id: Swift.Int? = nil, + actorId: Swift.Int? = nil, + actorName: Swift.String? = nil, + beforeSha: Swift.String? = nil, + afterSha: Swift.String? = nil, + ref: Swift.String? = nil, + repositoryId: Swift.Int? = nil, + repositoryName: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + result: Components.Schemas.RuleSuitesPayload.ResultPayload? = nil, + evaluationResult: Components.Schemas.RuleSuitesPayload.EvaluationResultPayload? = nil + ) { + self.id = id + self.actorId = actorId + self.actorName = actorName + self.beforeSha = beforeSha + self.afterSha = afterSha + self.ref = ref + self.repositoryId = repositoryId + self.repositoryName = repositoryName + self.pushedAt = pushedAt + self.result = result + self.evaluationResult = evaluationResult + } + public enum CodingKeys: String, CodingKey { + case id + case actorId = "actor_id" + case actorName = "actor_name" + case beforeSha = "before_sha" + case afterSha = "after_sha" + case ref + case repositoryId = "repository_id" + case repositoryName = "repository_name" + case pushedAt = "pushed_at" + case result + case evaluationResult = "evaluation_result" + } + } + /// Response + /// + /// - Remark: Generated from `#/components/schemas/rule-suites`. + public typealias RuleSuites = [Components.Schemas.RuleSuitesPayload] + /// Response + /// + /// - Remark: Generated from `#/components/schemas/rule-suite`. + public struct RuleSuite: Codable, Hashable, Sendable { + /// The unique identifier of the rule insight. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/id`. + public var id: Swift.Int? + /// The number that identifies the user. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/actor_id`. + public var actorId: Swift.Int? + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/actor_name`. + public var actorName: Swift.String? + /// The previous commit SHA of the ref. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/before_sha`. + public var beforeSha: Swift.String? + /// The new commit SHA of the ref. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/after_sha`. + public var afterSha: Swift.String? + /// The ref name that the evaluation ran on. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/ref`. + public var ref: Swift.String? + /// The ID of the repository associated with the rule evaluation. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/repository_id`. + public var repositoryId: Swift.Int? + /// The name of the repository without the `.git` extension. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/repository_name`. + public var repositoryName: Swift.String? + /// - Remark: Generated from `#/components/schemas/rule-suite/pushed_at`. + public var pushedAt: Foundation.Date? + /// The result of the rule evaluations for rules with the `active` enforcement status. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/result`. + @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pass = "pass" + case fail = "fail" + case bypass = "bypass" + } + /// The result of the rule evaluations for rules with the `active` enforcement status. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/result`. + public var result: Components.Schemas.RuleSuite.ResultPayload? + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. + @frozen public enum EvaluationResultPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pass = "pass" + case fail = "fail" + case bypass = "bypass" + } + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. + public var evaluationResult: Components.Schemas.RuleSuite.EvaluationResultPayload? + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload`. + public struct RuleEvaluationsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source`. + public struct RuleSourcePayload: Codable, Hashable, Sendable { + /// The type of rule source. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/type`. public var _type: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/site_admin`. - public var siteAdmin: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `OwnerPayload`. + /// The ID of the rule source. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/id`. + public var id: Swift.Int? + /// The name of the rule source. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source/name`. + public var name: Swift.String? + /// Creates a new `RuleSourcePayload`. /// /// - Parameters: - /// - login: - /// - id: - /// - nodeId: - /// - url: - /// - reposUrl: - /// - eventsUrl: - /// - hooksUrl: - /// - issuesUrl: - /// - membersUrl: - /// - publicMembersUrl: - /// - avatarUrl: - /// - description: - /// - gravatarId: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - userViewType: + /// - _type: The type of rule source. + /// - id: The ID of the rule source. + /// - name: The name of the rule source. public init( - login: Swift.String? = nil, - id: Swift.Int? = nil, - nodeId: Swift.String? = nil, - url: Swift.String? = nil, - reposUrl: Swift.String? = nil, - eventsUrl: Swift.String? = nil, - hooksUrl: Swift.String? = nil, - issuesUrl: Swift.String? = nil, - membersUrl: Swift.String? = nil, - publicMembersUrl: Swift.String? = nil, - avatarUrl: Swift.String? = nil, - description: Swift.String? = nil, - gravatarId: Swift.String? = nil, - htmlUrl: Swift.String? = nil, - followersUrl: Swift.String? = nil, - followingUrl: Swift.String? = nil, - gistsUrl: Swift.String? = nil, - starredUrl: Swift.String? = nil, - subscriptionsUrl: Swift.String? = nil, - organizationsUrl: Swift.String? = nil, - receivedEventsUrl: Swift.String? = nil, _type: Swift.String? = nil, - siteAdmin: Swift.Bool? = nil, - userViewType: Swift.String? = nil + id: Swift.Int? = nil, + name: Swift.String? = nil ) { - self.login = login - self.id = id - self.nodeId = nodeId - self.url = url - self.reposUrl = reposUrl - self.eventsUrl = eventsUrl - self.hooksUrl = hooksUrl - self.issuesUrl = issuesUrl - self.membersUrl = membersUrl - self.publicMembersUrl = publicMembersUrl - self.avatarUrl = avatarUrl - self.description = description - self.gravatarId = gravatarId - self.htmlUrl = htmlUrl - self.followersUrl = followersUrl - self.followingUrl = followingUrl - self.gistsUrl = gistsUrl - self.starredUrl = starredUrl - self.subscriptionsUrl = subscriptionsUrl - self.organizationsUrl = organizationsUrl - self.receivedEventsUrl = receivedEventsUrl self._type = _type - self.siteAdmin = siteAdmin - self.userViewType = userViewType + self.id = id + self.name = name } public enum CodingKeys: String, CodingKey { - case login - case id - case nodeId = "node_id" - case url - case reposUrl = "repos_url" - case eventsUrl = "events_url" - case hooksUrl = "hooks_url" - case issuesUrl = "issues_url" - case membersUrl = "members_url" - case publicMembersUrl = "public_members_url" - case avatarUrl = "avatar_url" - case description - case gravatarId = "gravatar_id" - 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 receivedEventsUrl = "received_events_url" case _type = "type" - case siteAdmin = "site_admin" - case userViewType = "user_view_type" + case id + case name } } - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner`. - public var owner: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.OwnerPayload? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/client_id`. - public var clientId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/external_url`. - public var externalUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/html_url`. - public var htmlUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/created_at`. - public var createdAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/updated_at`. - public var updatedAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/metadata`. - public var metadata: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/contents`. - public var contents: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/issues`. - public var issues: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/single_file`. - public var singleFile: Swift.String? - /// Creates a new `PermissionsPayload`. - /// - /// - Parameters: - /// - metadata: - /// - contents: - /// - issues: - /// - singleFile: - public init( - metadata: Swift.String? = nil, - contents: Swift.String? = nil, - issues: Swift.String? = nil, - singleFile: Swift.String? = nil - ) { - self.metadata = metadata - self.contents = contents - self.issues = issues - self.singleFile = singleFile - } - public enum CodingKeys: String, CodingKey { - case metadata - case contents - case issues - case singleFile = "single_file" - } + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_source`. + public var ruleSource: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.RuleSourcePayload? + /// The enforcement level of this rule source. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/enforcement`. + @frozen public enum EnforcementPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case evaluate = "evaluate" + case deletedRuleset = "deleted ruleset" } - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions`. - public var permissions: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/events`. - public var events: [Swift.String]? - /// Creates a new `AppsPayloadPayload`. + /// The enforcement level of this rule source. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/enforcement`. + public var enforcement: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.EnforcementPayload? + /// The result of the evaluation of the individual rule. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/result`. + @frozen public enum ResultPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pass = "pass" + case fail = "fail" + } + /// The result of the evaluation of the individual rule. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/result`. + public var result: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.ResultPayload? + /// The type of rule. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/rule_type`. + public var ruleType: Swift.String? + /// The detailed failure message for the rule. Null if the rule passed. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/RuleEvaluationsPayload/details`. + public var details: Swift.String? + /// Creates a new `RuleEvaluationsPayloadPayload`. /// /// - Parameters: - /// - id: - /// - slug: - /// - nodeId: - /// - owner: - /// - name: - /// - clientId: - /// - description: - /// - externalUrl: - /// - htmlUrl: - /// - createdAt: - /// - updatedAt: - /// - permissions: - /// - events: + /// - ruleSource: + /// - enforcement: The enforcement level of this rule source. + /// - result: The result of the evaluation of the individual rule. + /// - ruleType: The type of rule. + /// - details: The detailed failure message for the rule. Null if the rule passed. public init( - id: Swift.Int? = nil, - slug: Swift.String? = nil, - nodeId: Swift.String? = nil, - owner: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.OwnerPayload? = nil, - name: Swift.String? = nil, - clientId: Swift.String? = nil, - description: Swift.String? = nil, - externalUrl: Swift.String? = nil, - htmlUrl: Swift.String? = nil, - createdAt: Swift.String? = nil, - updatedAt: Swift.String? = nil, - permissions: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.PermissionsPayload? = nil, - events: [Swift.String]? = nil + ruleSource: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.RuleSourcePayload? = nil, + enforcement: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.EnforcementPayload? = nil, + result: Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload.ResultPayload? = nil, + ruleType: Swift.String? = nil, + details: Swift.String? = nil ) { - self.id = id - self.slug = slug - self.nodeId = nodeId - self.owner = owner - self.name = name - self.clientId = clientId - self.description = description - self.externalUrl = externalUrl - self.htmlUrl = htmlUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - self.permissions = permissions - self.events = events + self.ruleSource = ruleSource + self.enforcement = enforcement + self.result = result + self.ruleType = ruleType + self.details = details } public enum CodingKeys: String, CodingKey { - case id - case slug - case nodeId = "node_id" - case owner - case name - case clientId = "client_id" - case description - case externalUrl = "external_url" - case htmlUrl = "html_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - case permissions - case events + case ruleSource = "rule_source" + case enforcement + case result + case ruleType = "rule_type" + case details } } - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps`. - public typealias AppsPayload = [Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps`. - public var apps: Components.Schemas.BranchRestrictionPolicy.AppsPayload - /// Creates a new `BranchRestrictionPolicy`. + /// Details on the evaluated rules. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluations`. + public typealias RuleEvaluationsPayload = [Components.Schemas.RuleSuite.RuleEvaluationsPayloadPayload] + /// Details on the evaluated rules. + /// + /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluations`. + public var ruleEvaluations: Components.Schemas.RuleSuite.RuleEvaluationsPayload? + /// Creates a new `RuleSuite`. /// /// - Parameters: - /// - url: - /// - usersUrl: - /// - teamsUrl: - /// - appsUrl: - /// - users: - /// - teams: - /// - apps: + /// - id: The unique identifier of the rule insight. + /// - actorId: The number that identifies the user. + /// - actorName: The handle for the GitHub user account. + /// - beforeSha: The previous commit SHA of the ref. + /// - afterSha: The new commit SHA of the ref. + /// - ref: The ref name that the evaluation ran on. + /// - repositoryId: The ID of the repository associated with the rule evaluation. + /// - repositoryName: The name of the repository without the `.git` extension. + /// - pushedAt: + /// - result: The result of the rule evaluations for rules with the `active` enforcement status. + /// - evaluationResult: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. + /// - ruleEvaluations: Details on the evaluated rules. public init( - url: Swift.String, - usersUrl: Swift.String, - teamsUrl: Swift.String, - appsUrl: Swift.String, - users: Components.Schemas.BranchRestrictionPolicy.UsersPayload, - teams: Components.Schemas.BranchRestrictionPolicy.TeamsPayload, - apps: Components.Schemas.BranchRestrictionPolicy.AppsPayload + id: Swift.Int? = nil, + actorId: Swift.Int? = nil, + actorName: Swift.String? = nil, + beforeSha: Swift.String? = nil, + afterSha: Swift.String? = nil, + ref: Swift.String? = nil, + repositoryId: Swift.Int? = nil, + repositoryName: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + result: Components.Schemas.RuleSuite.ResultPayload? = nil, + evaluationResult: Components.Schemas.RuleSuite.EvaluationResultPayload? = nil, + ruleEvaluations: Components.Schemas.RuleSuite.RuleEvaluationsPayload? = nil ) { - self.url = url - self.usersUrl = usersUrl - self.teamsUrl = teamsUrl - self.appsUrl = appsUrl - self.users = users - self.teams = teams - self.apps = apps + self.id = id + self.actorId = actorId + self.actorName = actorName + self.beforeSha = beforeSha + self.afterSha = afterSha + self.ref = ref + self.repositoryId = repositoryId + self.repositoryName = repositoryName + self.pushedAt = pushedAt + self.result = result + self.evaluationResult = evaluationResult + self.ruleEvaluations = ruleEvaluations } public enum CodingKeys: String, CodingKey { - case url - case usersUrl = "users_url" - case teamsUrl = "teams_url" - case appsUrl = "apps_url" - case users - case teams - case apps + case id + case actorId = "actor_id" + case actorName = "actor_name" + case beforeSha = "before_sha" + case afterSha = "after_sha" + case ref + case repositoryId = "repository_id" + case repositoryName = "repository_name" + case pushedAt = "pushed_at" + case result + case evaluationResult = "evaluation_result" + case ruleEvaluations = "rule_evaluations" } } - /// Branch Protection + /// The historical version of a ruleset /// - /// - Remark: Generated from `#/components/schemas/branch-protection`. - public struct BranchProtection: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-protection/enabled`. - public var enabled: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/branch-protection/required_status_checks`. - public var requiredStatusChecks: Components.Schemas.ProtectedBranchRequiredStatusCheck? - /// - Remark: Generated from `#/components/schemas/branch-protection/enforce_admins`. - public var enforceAdmins: Components.Schemas.ProtectedBranchAdminEnforced? - /// - Remark: Generated from `#/components/schemas/branch-protection/required_pull_request_reviews`. - public var requiredPullRequestReviews: Components.Schemas.ProtectedBranchPullRequestReview? - /// - Remark: Generated from `#/components/schemas/branch-protection/restrictions`. - public var restrictions: Components.Schemas.BranchRestrictionPolicy? - /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history`. - public struct RequiredLinearHistoryPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `RequiredLinearHistoryPayload`. + /// - Remark: Generated from `#/components/schemas/ruleset-version`. + public struct RulesetVersion: Codable, Hashable, Sendable { + /// The ID of the previous version of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/version_id`. + public var versionId: Swift.Int + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public struct ActorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/type`. + public var _type: Swift.String? + /// Creates a new `ActorPayload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled + /// - id: + /// - _type: + public init( + id: Swift.Int? = nil, + _type: Swift.String? = nil + ) { + self.id = id + self._type = _type } public enum CodingKeys: String, CodingKey { - case enabled + case id + case _type = "type" } } - /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history`. - public var requiredLinearHistory: Components.Schemas.BranchProtection.RequiredLinearHistoryPayload? - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes`. - public struct AllowForcePushesPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `AllowForcePushesPayload`. + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public var actor: Components.Schemas.RulesetVersion.ActorPayload + /// - Remark: Generated from `#/components/schemas/ruleset-version/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `RulesetVersion`. + /// + /// - Parameters: + /// - versionId: The ID of the previous version of the ruleset + /// - actor: The actor who updated the ruleset + /// - updatedAt: + public init( + versionId: Swift.Int, + actor: Components.Schemas.RulesetVersion.ActorPayload, + updatedAt: Foundation.Date + ) { + self.versionId = versionId + self.actor = actor + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case versionId = "version_id" + case actor + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state`. + public struct RulesetVersionWithState: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value1`. + public var value1: Components.Schemas.RulesetVersion + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// The state of the ruleset version + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2/state`. + public var state: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value2Payload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled + /// - state: The state of the ruleset version + public init(state: OpenAPIRuntime.OpenAPIObjectContainer) { + self.state = state } public enum CodingKeys: String, CodingKey { - case enabled + case state } } - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes`. - public var allowForcePushes: Components.Schemas.BranchProtection.AllowForcePushesPayload? - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions`. - public struct AllowDeletionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `AllowDeletionsPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public var value2: Components.Schemas.RulesetVersionWithState.Value2Payload + /// Creates a new `RulesetVersionWithState`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RulesetVersion, + value2: Components.Schemas.RulesetVersionWithState.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 } - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions`. - public var allowDeletions: Components.Schemas.BranchProtection.AllowDeletionsPayload? - /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations`. - public struct BlockCreationsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `BlockCreationsPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) } - /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations`. - public var blockCreations: Components.Schemas.BranchProtection.BlockCreationsPayload? - /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution`. - public struct RequiredConversationResolutionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `RequiredConversationResolutionPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) } - /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution`. - public var requiredConversationResolution: Components.Schemas.BranchProtection.RequiredConversationResolutionPayload? - /// - Remark: Generated from `#/components/schemas/branch-protection/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-protection/protection_url`. - public var protectionUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures`. - public struct RequiredSignaturesPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures/enabled`. - public var enabled: Swift.Bool - /// Creates a new `RequiredSignaturesPayload`. - /// - /// - Parameters: - /// - url: - /// - enabled: - public init( - url: Swift.String, - enabled: Swift.Bool - ) { - self.url = url - self.enabled = enabled + } + /// The type of reviewer. + /// + /// - Remark: Generated from `#/components/schemas/deployment-reviewer-type`. + @frozen public enum DeploymentReviewerType: String, Codable, Hashable, Sendable, CaseIterable { + case user = "User" + case team = "Team" + } + /// A request for a specific ref(branch,sha,tag) to be deployed + /// + /// - Remark: Generated from `#/components/schemas/deployment`. + public struct Deployment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/deployment/url`. + public var url: Swift.String + /// Unique identifier of the deployment + /// + /// - Remark: Generated from `#/components/schemas/deployment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/deployment/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/deployment/sha`. + public var sha: Swift.String + /// The ref to deploy. This can be a branch, tag, or sha. + /// + /// - Remark: Generated from `#/components/schemas/deployment/ref`. + public var ref: Swift.String + /// Parameter to specify a task to execute + /// + /// - Remark: Generated from `#/components/schemas/deployment/task`. + public var task: Swift.String + /// - Remark: Generated from `#/components/schemas/deployment/payload`. + @frozen public enum PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/deployment/payload/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } } - public enum CodingKeys: String, CodingKey { - case url - case enabled + /// - Remark: Generated from `#/components/schemas/deployment/payload/case1`. + case case1(Components.Schemas.Deployment.PayloadPayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/deployment/payload/case2`. + case case2(Swift.String) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } } } - /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures`. - public var requiredSignatures: Components.Schemas.BranchProtection.RequiredSignaturesPayload? - /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// - Remark: Generated from `#/components/schemas/deployment/payload`. + public var payload: Components.Schemas.Deployment.PayloadPayload + /// - Remark: Generated from `#/components/schemas/deployment/original_environment`. + public var originalEnvironment: Swift.String? + /// Name for the target deployment environment. + /// + /// - Remark: Generated from `#/components/schemas/deployment/environment`. + public var environment: Swift.String + /// - Remark: Generated from `#/components/schemas/deployment/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/deployment/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/deployment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/deployment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/deployment/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/deployment/repository_url`. + public var repositoryUrl: Swift.String + /// Specifies if the given environment is will no longer exist at some point in the future. Default: false. + /// + /// - Remark: Generated from `#/components/schemas/deployment/transient_environment`. + public var transientEnvironment: Swift.Bool? + /// Specifies if the given environment is one that end-users directly interact with. Default: false. + /// + /// - Remark: Generated from `#/components/schemas/deployment/production_environment`. + public var productionEnvironment: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/deployment/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// Creates a new `Deployment`. + /// + /// - Parameters: + /// - url: + /// - id: Unique identifier of the deployment + /// - nodeId: + /// - sha: + /// - ref: The ref to deploy. This can be a branch, tag, or sha. + /// - task: Parameter to specify a task to execute + /// - payload: + /// - originalEnvironment: + /// - environment: Name for the target deployment environment. + /// - description: + /// - creator: + /// - createdAt: + /// - updatedAt: + /// - statusesUrl: + /// - repositoryUrl: + /// - transientEnvironment: Specifies if the given environment is will no longer exist at some point in the future. Default: false. + /// - productionEnvironment: Specifies if the given environment is one that end-users directly interact with. Default: false. + /// - performedViaGithubApp: + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + sha: Swift.String, + ref: Swift.String, + task: Swift.String, + payload: Components.Schemas.Deployment.PayloadPayload, + originalEnvironment: Swift.String? = nil, + environment: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + statusesUrl: Swift.String, + repositoryUrl: Swift.String, + transientEnvironment: Swift.Bool? = nil, + productionEnvironment: Swift.Bool? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.sha = sha + self.ref = ref + self.task = task + self.payload = payload + self.originalEnvironment = originalEnvironment + self.environment = environment + self.description = description + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.statusesUrl = statusesUrl + self.repositoryUrl = repositoryUrl + self.transientEnvironment = transientEnvironment + self.productionEnvironment = productionEnvironment + self.performedViaGithubApp = performedViaGithubApp + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case sha + case ref + case task + case payload + case originalEnvironment = "original_environment" + case environment + case description + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case statusesUrl = "statuses_url" + case repositoryUrl = "repository_url" + case transientEnvironment = "transient_environment" + case productionEnvironment = "production_environment" + case performedViaGithubApp = "performed_via_github_app" + } + } + /// Activity + /// + /// - Remark: Generated from `#/components/schemas/activity`. + public struct Activity: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/activity/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/activity/node_id`. + public var nodeId: Swift.String + /// The SHA of the commit before the activity. /// - /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch`. - public struct LockBranchPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `LockBranchPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + /// - Remark: Generated from `#/components/schemas/activity/before`. + public var before: Swift.String + /// The SHA of the commit after the activity. + /// + /// - Remark: Generated from `#/components/schemas/activity/after`. + public var after: Swift.String + /// The full Git reference, formatted as `refs/heads/`. + /// + /// - Remark: Generated from `#/components/schemas/activity/ref`. + public var ref: Swift.String + /// The time when the activity occurred. + /// + /// - Remark: Generated from `#/components/schemas/activity/timestamp`. + public var timestamp: Foundation.Date + /// The type of the activity that was performed. + /// + /// - Remark: Generated from `#/components/schemas/activity/activity_type`. + @frozen public enum ActivityTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case push = "push" + case forcePush = "force_push" + case branchDeletion = "branch_deletion" + case branchCreation = "branch_creation" + case prMerge = "pr_merge" + case mergeQueueMerge = "merge_queue_merge" } - /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// The type of the activity that was performed. /// - /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch`. - public var lockBranch: Components.Schemas.BranchProtection.LockBranchPayload? - /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// - Remark: Generated from `#/components/schemas/activity/activity_type`. + public var activityType: Components.Schemas.Activity.ActivityTypePayload + /// - Remark: Generated from `#/components/schemas/activity/actor`. + public var actor: Components.Schemas.NullableSimpleUser? + /// Creates a new `Activity`. /// - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing`. - public struct AllowForkSyncingPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `AllowForkSyncingPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + /// - Parameters: + /// - id: + /// - nodeId: + /// - before: The SHA of the commit before the activity. + /// - after: The SHA of the commit after the activity. + /// - ref: The full Git reference, formatted as `refs/heads/`. + /// - timestamp: The time when the activity occurred. + /// - activityType: The type of the activity that was performed. + /// - actor: + public init( + id: Swift.Int, + nodeId: Swift.String, + before: Swift.String, + after: Swift.String, + ref: Swift.String, + timestamp: Foundation.Date, + activityType: Components.Schemas.Activity.ActivityTypePayload, + actor: Components.Schemas.NullableSimpleUser? = nil + ) { + self.id = id + self.nodeId = nodeId + self.before = before + self.after = after + self.ref = ref + self.timestamp = timestamp + self.activityType = activityType + self.actor = actor } - /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case before + case after + case ref + case timestamp + case activityType = "activity_type" + case actor + } + } + /// An autolink reference. + /// + /// - Remark: Generated from `#/components/schemas/autolink`. + public struct Autolink: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/autolink/id`. + public var id: Swift.Int + /// The prefix of a key that is linkified. /// - /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing`. - public var allowForkSyncing: Components.Schemas.BranchProtection.AllowForkSyncingPayload? - /// Creates a new `BranchProtection`. + /// - Remark: Generated from `#/components/schemas/autolink/key_prefix`. + public var keyPrefix: Swift.String + /// A template for the target URL that is generated if a key was found. + /// + /// - Remark: Generated from `#/components/schemas/autolink/url_template`. + public var urlTemplate: Swift.String + /// Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. + /// + /// - Remark: Generated from `#/components/schemas/autolink/is_alphanumeric`. + public var isAlphanumeric: Swift.Bool + /// - Remark: Generated from `#/components/schemas/autolink/updated_at`. + public var updatedAt: Foundation.Date? + /// Creates a new `Autolink`. /// /// - Parameters: - /// - url: - /// - enabled: - /// - requiredStatusChecks: - /// - enforceAdmins: - /// - requiredPullRequestReviews: - /// - restrictions: - /// - requiredLinearHistory: - /// - allowForcePushes: - /// - allowDeletions: - /// - blockCreations: - /// - requiredConversationResolution: - /// - name: - /// - protectionUrl: - /// - requiredSignatures: - /// - lockBranch: Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. - /// - allowForkSyncing: Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// - id: + /// - keyPrefix: The prefix of a key that is linkified. + /// - urlTemplate: A template for the target URL that is generated if a key was found. + /// - isAlphanumeric: Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. + /// - updatedAt: public init( - url: Swift.String? = nil, - enabled: Swift.Bool? = nil, - requiredStatusChecks: Components.Schemas.ProtectedBranchRequiredStatusCheck? = nil, - enforceAdmins: Components.Schemas.ProtectedBranchAdminEnforced? = nil, - requiredPullRequestReviews: Components.Schemas.ProtectedBranchPullRequestReview? = nil, - restrictions: Components.Schemas.BranchRestrictionPolicy? = nil, - requiredLinearHistory: Components.Schemas.BranchProtection.RequiredLinearHistoryPayload? = nil, - allowForcePushes: Components.Schemas.BranchProtection.AllowForcePushesPayload? = nil, - allowDeletions: Components.Schemas.BranchProtection.AllowDeletionsPayload? = nil, - blockCreations: Components.Schemas.BranchProtection.BlockCreationsPayload? = nil, - requiredConversationResolution: Components.Schemas.BranchProtection.RequiredConversationResolutionPayload? = nil, - name: Swift.String? = nil, - protectionUrl: Swift.String? = nil, - requiredSignatures: Components.Schemas.BranchProtection.RequiredSignaturesPayload? = nil, - lockBranch: Components.Schemas.BranchProtection.LockBranchPayload? = nil, - allowForkSyncing: Components.Schemas.BranchProtection.AllowForkSyncingPayload? = nil + id: Swift.Int, + keyPrefix: Swift.String, + urlTemplate: Swift.String, + isAlphanumeric: Swift.Bool, + updatedAt: Foundation.Date? = nil ) { - self.url = url - self.enabled = enabled - self.requiredStatusChecks = requiredStatusChecks - self.enforceAdmins = enforceAdmins - self.requiredPullRequestReviews = requiredPullRequestReviews - self.restrictions = restrictions - self.requiredLinearHistory = requiredLinearHistory - self.allowForcePushes = allowForcePushes - self.allowDeletions = allowDeletions - self.blockCreations = blockCreations - self.requiredConversationResolution = requiredConversationResolution - self.name = name - self.protectionUrl = protectionUrl - self.requiredSignatures = requiredSignatures - self.lockBranch = lockBranch - self.allowForkSyncing = allowForkSyncing + self.id = id + self.keyPrefix = keyPrefix + self.urlTemplate = urlTemplate + self.isAlphanumeric = isAlphanumeric + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case keyPrefix = "key_prefix" + case urlTemplate = "url_template" + case isAlphanumeric = "is_alphanumeric" + case updatedAt = "updated_at" + } + } + /// Check Dependabot security updates + /// + /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes`. + public struct CheckAutomatedSecurityFixes: Codable, Hashable, Sendable { + /// Whether Dependabot security updates are enabled for the repository. + /// + /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/enabled`. + public var enabled: Swift.Bool + /// Whether Dependabot security updates are paused for the repository. + /// + /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/paused`. + public var paused: Swift.Bool + /// Creates a new `CheckAutomatedSecurityFixes`. + /// + /// - Parameters: + /// - enabled: Whether Dependabot security updates are enabled for the repository. + /// - paused: Whether Dependabot security updates are paused for the repository. + public init( + enabled: Swift.Bool, + paused: Swift.Bool + ) { + self.enabled = enabled + self.paused = paused } public enum CodingKeys: String, CodingKey { - case url case enabled - case requiredStatusChecks = "required_status_checks" - case enforceAdmins = "enforce_admins" - case requiredPullRequestReviews = "required_pull_request_reviews" - case restrictions - case requiredLinearHistory = "required_linear_history" - case allowForcePushes = "allow_force_pushes" - case allowDeletions = "allow_deletions" - case blockCreations = "block_creations" - case requiredConversationResolution = "required_conversation_resolution" - case name - case protectionUrl = "protection_url" - case requiredSignatures = "required_signatures" - case lockBranch = "lock_branch" - case allowForkSyncing = "allow_fork_syncing" + case paused } } - /// Short Branch + /// Protected Branch Required Status Check /// - /// - Remark: Generated from `#/components/schemas/short-branch`. - public struct ShortBranch: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/short-branch/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/short-branch/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/short-branch/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/short-branch/commit/url`. - public var url: Swift.String - /// Creates a new `CommitPayload`. + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check`. + public struct ProtectedBranchRequiredStatusCheck: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/enforcement_level`. + public var enforcementLevel: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/contexts`. + public var contexts: [Swift.String] + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload`. + public struct ChecksPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload/context`. + public var context: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/ChecksPayload/app_id`. + public var appId: Swift.Int? + /// Creates a new `ChecksPayloadPayload`. /// /// - Parameters: - /// - sha: - /// - url: + /// - context: + /// - appId: public init( - sha: Swift.String, - url: Swift.String + context: Swift.String, + appId: Swift.Int? = nil ) { - self.sha = sha - self.url = url + self.context = context + self.appId = appId } public enum CodingKeys: String, CodingKey { - case sha - case url + case context + case appId = "app_id" } } - /// - Remark: Generated from `#/components/schemas/short-branch/commit`. - public var commit: Components.Schemas.ShortBranch.CommitPayload - /// - Remark: Generated from `#/components/schemas/short-branch/protected`. - public var protected: Swift.Bool - /// - Remark: Generated from `#/components/schemas/short-branch/protection`. - public var protection: Components.Schemas.BranchProtection? - /// - Remark: Generated from `#/components/schemas/short-branch/protection_url`. - public var protectionUrl: Swift.String? - /// Creates a new `ShortBranch`. + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/checks`. + public typealias ChecksPayload = [Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayloadPayload] + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/checks`. + public var checks: Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayload + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/contexts_url`. + public var contextsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-required-status-check/strict`. + public var strict: Swift.Bool? + /// Creates a new `ProtectedBranchRequiredStatusCheck`. /// /// - Parameters: - /// - name: - /// - commit: - /// - protected: - /// - protection: - /// - protectionUrl: + /// - url: + /// - enforcementLevel: + /// - contexts: + /// - checks: + /// - contextsUrl: + /// - strict: public init( - name: Swift.String, - commit: Components.Schemas.ShortBranch.CommitPayload, - protected: Swift.Bool, - protection: Components.Schemas.BranchProtection? = nil, - protectionUrl: Swift.String? = nil + url: Swift.String? = nil, + enforcementLevel: Swift.String? = nil, + contexts: [Swift.String], + checks: Components.Schemas.ProtectedBranchRequiredStatusCheck.ChecksPayload, + contextsUrl: Swift.String? = nil, + strict: Swift.Bool? = nil ) { - self.name = name - self.commit = commit - self.protected = protected - self.protection = protection - self.protectionUrl = protectionUrl + self.url = url + self.enforcementLevel = enforcementLevel + self.contexts = contexts + self.checks = checks + self.contextsUrl = contextsUrl + self.strict = strict } public enum CodingKeys: String, CodingKey { - case name - case commit - case protected - case protection - case protectionUrl = "protection_url" + case url + case enforcementLevel = "enforcement_level" + case contexts + case checks + case contextsUrl = "contexts_url" + case strict } } - /// Metaproperties for Git author/committer information. + /// Protected Branch Admin Enforced /// - /// - Remark: Generated from `#/components/schemas/nullable-git-user`. - public struct NullableGitUser: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? - /// Creates a new `NullableGitUser`. + /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced`. + public struct ProtectedBranchAdminEnforced: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch-admin-enforced/enabled`. + public var enabled: Swift.Bool + /// Creates a new `ProtectedBranchAdminEnforced`. /// /// - Parameters: - /// - name: - /// - email: - /// - date: + /// - url: + /// - enabled: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - date: Swift.String? = nil + url: Swift.String, + enabled: Swift.Bool ) { - self.name = name - self.email = email - self.date = date + self.url = url + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case name - case email - case date + case url + case enabled + } + } + /// Protected Branch Pull Request Review + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review`. + public struct ProtectedBranchPullRequestReview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions`. + public struct DismissalRestrictionsPayload: Codable, Hashable, Sendable { + /// The list of users with review dismissal access. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/users`. + public var users: [Components.Schemas.SimpleUser]? + /// The list of teams with review dismissal access. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/teams`. + public var teams: [Components.Schemas.Team]? + /// The list of apps with review dismissal access. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/apps`. + public var apps: [Components.Schemas.Integration]? + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/users_url`. + public var usersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions/teams_url`. + public var teamsUrl: Swift.String? + /// Creates a new `DismissalRestrictionsPayload`. + /// + /// - Parameters: + /// - users: The list of users with review dismissal access. + /// - teams: The list of teams with review dismissal access. + /// - apps: The list of apps with review dismissal access. + /// - url: + /// - usersUrl: + /// - teamsUrl: + public init( + users: [Components.Schemas.SimpleUser]? = nil, + teams: [Components.Schemas.Team]? = nil, + apps: [Components.Schemas.Integration]? = nil, + url: Swift.String? = nil, + usersUrl: Swift.String? = nil, + teamsUrl: Swift.String? = nil + ) { + self.users = users + self.teams = teams + self.apps = apps + self.url = url + self.usersUrl = usersUrl + self.teamsUrl = teamsUrl + } + public enum CodingKeys: String, CodingKey { + case users + case teams + case apps + case url + case usersUrl = "users_url" + case teamsUrl = "teams_url" + } + } + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismissal_restrictions`. + public var dismissalRestrictions: Components.Schemas.ProtectedBranchPullRequestReview.DismissalRestrictionsPayload? + /// Allow specific users, teams, or apps to bypass pull request requirements. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances`. + public struct BypassPullRequestAllowancesPayload: Codable, Hashable, Sendable { + /// The list of users allowed to bypass pull request requirements. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/users`. + public var users: [Components.Schemas.SimpleUser]? + /// The list of teams allowed to bypass pull request requirements. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/teams`. + public var teams: [Components.Schemas.Team]? + /// The list of apps allowed to bypass pull request requirements. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances/apps`. + public var apps: [Components.Schemas.Integration]? + /// Creates a new `BypassPullRequestAllowancesPayload`. + /// + /// - Parameters: + /// - users: The list of users allowed to bypass pull request requirements. + /// - teams: The list of teams allowed to bypass pull request requirements. + /// - apps: The list of apps allowed to bypass pull request requirements. + public init( + users: [Components.Schemas.SimpleUser]? = nil, + teams: [Components.Schemas.Team]? = nil, + apps: [Components.Schemas.Integration]? = nil + ) { + self.users = users + self.teams = teams + self.apps = apps + } + public enum CodingKeys: String, CodingKey { + case users + case teams + case apps + } } - } - /// - Remark: Generated from `#/components/schemas/verification`. - public struct Verification: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/verification/verified`. - public var verified: Swift.Bool - /// - Remark: Generated from `#/components/schemas/verification/reason`. - public var reason: Swift.String - /// - Remark: Generated from `#/components/schemas/verification/payload`. - public var payload: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/signature`. - public var signature: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/verified_at`. - public var verifiedAt: Swift.String? - /// Creates a new `Verification`. + /// Allow specific users, teams, or apps to bypass pull request requirements. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/bypass_pull_request_allowances`. + public var bypassPullRequestAllowances: Components.Schemas.ProtectedBranchPullRequestReview.BypassPullRequestAllowancesPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/dismiss_stale_reviews`. + public var dismissStaleReviews: Swift.Bool + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/require_code_owner_reviews`. + public var requireCodeOwnerReviews: Swift.Bool + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/required_approving_review_count`. + public var requiredApprovingReviewCount: Swift.Int? + /// Whether the most recent push must be approved by someone other than the person who pushed it. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch-pull-request-review/require_last_push_approval`. + public var requireLastPushApproval: Swift.Bool? + /// Creates a new `ProtectedBranchPullRequestReview`. /// /// - Parameters: - /// - verified: - /// - reason: - /// - payload: - /// - signature: - /// - verifiedAt: + /// - url: + /// - dismissalRestrictions: + /// - bypassPullRequestAllowances: Allow specific users, teams, or apps to bypass pull request requirements. + /// - dismissStaleReviews: + /// - requireCodeOwnerReviews: + /// - requiredApprovingReviewCount: + /// - requireLastPushApproval: Whether the most recent push must be approved by someone other than the person who pushed it. public init( - verified: Swift.Bool, - reason: Swift.String, - payload: Swift.String? = nil, - signature: Swift.String? = nil, - verifiedAt: Swift.String? = nil + url: Swift.String? = nil, + dismissalRestrictions: Components.Schemas.ProtectedBranchPullRequestReview.DismissalRestrictionsPayload? = nil, + bypassPullRequestAllowances: Components.Schemas.ProtectedBranchPullRequestReview.BypassPullRequestAllowancesPayload? = nil, + dismissStaleReviews: Swift.Bool, + requireCodeOwnerReviews: Swift.Bool, + requiredApprovingReviewCount: Swift.Int? = nil, + requireLastPushApproval: Swift.Bool? = nil ) { - self.verified = verified - self.reason = reason - self.payload = payload - self.signature = signature - self.verifiedAt = verifiedAt + self.url = url + self.dismissalRestrictions = dismissalRestrictions + self.bypassPullRequestAllowances = bypassPullRequestAllowances + self.dismissStaleReviews = dismissStaleReviews + self.requireCodeOwnerReviews = requireCodeOwnerReviews + self.requiredApprovingReviewCount = requiredApprovingReviewCount + self.requireLastPushApproval = requireLastPushApproval } public enum CodingKeys: String, CodingKey { - case verified - case reason - case payload - case signature - case verifiedAt = "verified_at" + case url + case dismissalRestrictions = "dismissal_restrictions" + case bypassPullRequestAllowances = "bypass_pull_request_allowances" + case dismissStaleReviews = "dismiss_stale_reviews" + case requireCodeOwnerReviews = "require_code_owner_reviews" + case requiredApprovingReviewCount = "required_approving_review_count" + case requireLastPushApproval = "require_last_push_approval" } } - /// Diff Entry + /// Branch Restriction Policy /// - /// - Remark: Generated from `#/components/schemas/diff-entry`. - public struct DiffEntry: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case added = "added" - case removed = "removed" - case modified = "modified" - case renamed = "renamed" - case copied = "copied" - case changed = "changed" - case unchanged = "unchanged" - } - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - public var status: Components.Schemas.DiffEntry.StatusPayload - /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. - public var additions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. - public var deletions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. - public var changes: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. - public var blobUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. - public var rawUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. - public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. - public var patch: Swift.String? - /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. - public var previousFilename: Swift.String? - /// Creates a new `DiffEntry`. - /// - /// - Parameters: - /// - sha: - /// - filename: - /// - status: - /// - additions: - /// - deletions: - /// - changes: - /// - blobUrl: - /// - rawUrl: - /// - contentsUrl: - /// - patch: - /// - previousFilename: - public init( - sha: Swift.String, - filename: Swift.String, - status: Components.Schemas.DiffEntry.StatusPayload, - additions: Swift.Int, - deletions: Swift.Int, - changes: Swift.Int, - blobUrl: Swift.String, - rawUrl: Swift.String, - contentsUrl: Swift.String, - patch: Swift.String? = nil, - previousFilename: Swift.String? = nil - ) { - self.sha = sha - self.filename = filename - self.status = status - self.additions = additions - self.deletions = deletions - self.changes = changes - self.blobUrl = blobUrl - self.rawUrl = rawUrl - self.contentsUrl = contentsUrl - self.patch = patch - self.previousFilename = previousFilename - } - public enum CodingKeys: String, CodingKey { - case sha - case filename - case status - case additions - case deletions - case changes - case blobUrl = "blob_url" - case rawUrl = "raw_url" - case contentsUrl = "contents_url" - case patch - case previousFilename = "previous_filename" + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy`. + public struct BranchRestrictionPolicy: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users_url`. + public var usersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps_url`. + public var appsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload`. + public struct UsersPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/login`. + public var login: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/id`. + public var id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/avatar_url`. + public var avatarUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/followers_url`. + public var followersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/following_url`. + public var followingUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/gists_url`. + public var gistsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/starred_url`. + public var starredUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/subscriptions_url`. + public var subscriptionsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/organizations_url`. + public var organizationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/repos_url`. + public var reposUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/received_events_url`. + public var receivedEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/type`. + public var _type: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/site_admin`. + public var siteAdmin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/UsersPayload/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `UsersPayloadPayload`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - userViewType: + public init( + login: Swift.String? = nil, + id: Swift.Int64? = nil, + nodeId: Swift.String? = nil, + avatarUrl: Swift.String? = nil, + gravatarId: Swift.String? = nil, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + followersUrl: Swift.String? = nil, + followingUrl: Swift.String? = nil, + gistsUrl: Swift.String? = nil, + starredUrl: Swift.String? = nil, + subscriptionsUrl: Swift.String? = nil, + organizationsUrl: Swift.String? = nil, + reposUrl: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + receivedEventsUrl: Swift.String? = nil, + _type: Swift.String? = nil, + siteAdmin: Swift.Bool? = nil, + userViewType: Swift.String? = nil + ) { + 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.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + 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 userViewType = "user_view_type" + } } - } - /// Commit - /// - /// - Remark: Generated from `#/components/schemas/commit`. - public struct Commit: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/author`. - public var author: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. - public var committer: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. - public var commentCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public struct TreePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. - public var url: Swift.String - /// Creates a new `TreePayload`. + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. + public typealias UsersPayload = [Components.Schemas.BranchRestrictionPolicy.UsersPayloadPayload] + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. + public var users: Components.Schemas.BranchRestrictionPolicy.UsersPayload + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams`. + public var teams: [Components.Schemas.Team] + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload`. + public struct AppsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/slug`. + public var slug: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/login`. + public var login: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/repos_url`. + public var reposUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/events_url`. + public var eventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/hooks_url`. + public var hooksUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/issues_url`. + public var issuesUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/members_url`. + public var membersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/public_members_url`. + public var publicMembersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/avatar_url`. + public var avatarUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/followers_url`. + public var followersUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/following_url`. + public var followingUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/gists_url`. + public var gistsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/starred_url`. + public var starredUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/subscriptions_url`. + public var subscriptionsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/organizations_url`. + public var organizationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/received_events_url`. + public var receivedEventsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/type`. + public var _type: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/site_admin`. + public var siteAdmin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - nodeId: + /// - url: + /// - reposUrl: + /// - eventsUrl: + /// - hooksUrl: + /// - issuesUrl: + /// - membersUrl: + /// - publicMembersUrl: + /// - avatarUrl: + /// - description: + /// - gravatarId: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - userViewType: + public init( + login: Swift.String? = nil, + id: Swift.Int? = nil, + nodeId: Swift.String? = nil, + url: Swift.String? = nil, + reposUrl: Swift.String? = nil, + eventsUrl: Swift.String? = nil, + hooksUrl: Swift.String? = nil, + issuesUrl: Swift.String? = nil, + membersUrl: Swift.String? = nil, + publicMembersUrl: Swift.String? = nil, + avatarUrl: Swift.String? = nil, + description: Swift.String? = nil, + gravatarId: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + followersUrl: Swift.String? = nil, + followingUrl: Swift.String? = nil, + gistsUrl: Swift.String? = nil, + starredUrl: Swift.String? = nil, + subscriptionsUrl: Swift.String? = nil, + organizationsUrl: Swift.String? = nil, + receivedEventsUrl: Swift.String? = nil, + _type: Swift.String? = nil, + siteAdmin: Swift.Bool? = nil, + userViewType: Swift.String? = nil + ) { + self.login = login + self.id = id + self.nodeId = nodeId + self.url = url + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.hooksUrl = hooksUrl + self.issuesUrl = issuesUrl + self.membersUrl = membersUrl + self.publicMembersUrl = publicMembersUrl + self.avatarUrl = avatarUrl + self.description = description + self.gravatarId = gravatarId + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case login + case id + case nodeId = "node_id" + case url + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case hooksUrl = "hooks_url" + case issuesUrl = "issues_url" + case membersUrl = "members_url" + case publicMembersUrl = "public_members_url" + case avatarUrl = "avatar_url" + case description + case gravatarId = "gravatar_id" + 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 receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case userViewType = "user_view_type" + } + } + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/owner`. + public var owner: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.OwnerPayload? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/client_id`. + public var clientId: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/external_url`. + public var externalUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/updated_at`. + public var updatedAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/metadata`. + public var metadata: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/contents`. + public var contents: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/issues`. + public var issues: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions/single_file`. + public var singleFile: Swift.String? + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - sha: - /// - url: + /// - metadata: + /// - contents: + /// - issues: + /// - singleFile: public init( - sha: Swift.String, - url: Swift.String + metadata: Swift.String? = nil, + contents: Swift.String? = nil, + issues: Swift.String? = nil, + singleFile: Swift.String? = nil ) { - self.sha = sha - self.url = url + self.metadata = metadata + self.contents = contents + self.issues = issues + self.singleFile = singleFile } public enum CodingKeys: String, CodingKey { - case sha - case url + case metadata + case contents + case issues + case singleFile = "single_file" } } - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public var tree: Components.Schemas.Commit.CommitPayload.TreePayload - /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. - public var verification: Components.Schemas.Verification? - /// Creates a new `CommitPayload`. + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/permissions`. + public var permissions: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/events`. + public var events: [Swift.String]? + /// Creates a new `AppsPayloadPayload`. /// /// - Parameters: - /// - url: - /// - author: - /// - committer: - /// - message: - /// - commentCount: - /// - tree: - /// - verification: + /// - id: + /// - slug: + /// - nodeId: + /// - owner: + /// - name: + /// - clientId: + /// - description: + /// - externalUrl: + /// - htmlUrl: + /// - createdAt: + /// - updatedAt: + /// - permissions: + /// - events: public init( - url: Swift.String, - author: Components.Schemas.NullableGitUser? = nil, - committer: Components.Schemas.NullableGitUser? = nil, - message: Swift.String, - commentCount: Swift.Int, - tree: Components.Schemas.Commit.CommitPayload.TreePayload, - verification: Components.Schemas.Verification? = nil + id: Swift.Int? = nil, + slug: Swift.String? = nil, + nodeId: Swift.String? = nil, + owner: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.OwnerPayload? = nil, + name: Swift.String? = nil, + clientId: Swift.String? = nil, + description: Swift.String? = nil, + externalUrl: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil, + permissions: Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload.PermissionsPayload? = nil, + events: [Swift.String]? = nil ) { - self.url = url - self.author = author - self.committer = committer - self.message = message - self.commentCount = commentCount - self.tree = tree - self.verification = verification + self.id = id + self.slug = slug + self.nodeId = nodeId + self.owner = owner + self.name = name + self.clientId = clientId + self.description = description + self.externalUrl = externalUrl + self.htmlUrl = htmlUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + self.permissions = permissions + self.events = events } public enum CodingKeys: String, CodingKey { - case url - case author - case committer - case message - case commentCount = "comment_count" - case tree - case verification + case id + case slug + case nodeId = "node_id" + case owner + case name + case clientId = "client_id" + case description + case externalUrl = "external_url" + case htmlUrl = "html_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case events } } - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public var commit: Components.Schemas.Commit.CommitPayload - /// - Remark: Generated from `#/components/schemas/commit/author`. - @frozen public enum AuthorPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/author/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/author/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps`. + public typealias AppsPayload = [Components.Schemas.BranchRestrictionPolicy.AppsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/apps`. + public var apps: Components.Schemas.BranchRestrictionPolicy.AppsPayload + /// Creates a new `BranchRestrictionPolicy`. + /// + /// - Parameters: + /// - url: + /// - usersUrl: + /// - teamsUrl: + /// - appsUrl: + /// - users: + /// - teams: + /// - apps: + public init( + url: Swift.String, + usersUrl: Swift.String, + teamsUrl: Swift.String, + appsUrl: Swift.String, + users: Components.Schemas.BranchRestrictionPolicy.UsersPayload, + teams: [Components.Schemas.Team], + apps: Components.Schemas.BranchRestrictionPolicy.AppsPayload + ) { + self.url = url + self.usersUrl = usersUrl + self.teamsUrl = teamsUrl + self.appsUrl = appsUrl + self.users = users + self.teams = teams + self.apps = apps + } + public enum CodingKeys: String, CodingKey { + case url + case usersUrl = "users_url" + case teamsUrl = "teams_url" + case appsUrl = "apps_url" + case users + case teams + case apps + } + } + /// Branch Protection + /// + /// - Remark: Generated from `#/components/schemas/branch-protection`. + public struct BranchProtection: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-protection/enabled`. + public var enabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/branch-protection/required_status_checks`. + public var requiredStatusChecks: Components.Schemas.ProtectedBranchRequiredStatusCheck? + /// - Remark: Generated from `#/components/schemas/branch-protection/enforce_admins`. + public var enforceAdmins: Components.Schemas.ProtectedBranchAdminEnforced? + /// - Remark: Generated from `#/components/schemas/branch-protection/required_pull_request_reviews`. + public var requiredPullRequestReviews: Components.Schemas.ProtectedBranchPullRequestReview? + /// - Remark: Generated from `#/components/schemas/branch-protection/restrictions`. + public var restrictions: Components.Schemas.BranchRestrictionPolicy? + /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history`. + public struct RequiredLinearHistoryPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `RequiredLinearHistoryPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + } + /// - Remark: Generated from `#/components/schemas/branch-protection/required_linear_history`. + public var requiredLinearHistory: Components.Schemas.BranchProtection.RequiredLinearHistoryPayload? + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes`. + public struct AllowForcePushesPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `AllowForcePushesPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } + } + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_force_pushes`. + public var allowForcePushes: Components.Schemas.BranchProtection.AllowForcePushesPayload? + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions`. + public struct AllowDeletionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `AllowDeletionsPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled } } - /// - Remark: Generated from `#/components/schemas/commit/author`. - public var author: Components.Schemas.Commit.AuthorPayload? - /// - Remark: Generated from `#/components/schemas/commit/committer`. - @frozen public enum CommitterPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_deletions`. + public var allowDeletions: Components.Schemas.BranchProtection.AllowDeletionsPayload? + /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations`. + public struct BlockCreationsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `BlockCreationsPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } + public enum CodingKeys: String, CodingKey { + case enabled } } - /// - Remark: Generated from `#/components/schemas/commit/committer`. - public var committer: Components.Schemas.Commit.CommitterPayload? - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. - public struct ParentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. + /// - Remark: Generated from `#/components/schemas/branch-protection/block_creations`. + public var blockCreations: Components.Schemas.BranchProtection.BlockCreationsPayload? + /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution`. + public struct RequiredConversationResolutionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `RequiredConversationResolutionPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + } + /// - Remark: Generated from `#/components/schemas/branch-protection/required_conversation_resolution`. + public var requiredConversationResolution: Components.Schemas.BranchProtection.RequiredConversationResolutionPayload? + /// - Remark: Generated from `#/components/schemas/branch-protection/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-protection/protection_url`. + public var protectionUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures`. + public struct RequiredSignaturesPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. - public var htmlUrl: Swift.String? - /// Creates a new `ParentsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures/enabled`. + public var enabled: Swift.Bool + /// Creates a new `RequiredSignaturesPayload`. /// /// - Parameters: - /// - sha: /// - url: - /// - htmlUrl: + /// - enabled: public init( - sha: Swift.String, url: Swift.String, - htmlUrl: Swift.String? = nil + enabled: Swift.Bool ) { - self.sha = sha self.url = url - self.htmlUrl = htmlUrl + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case sha case url - case htmlUrl = "html_url" + case enabled } } - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public var parents: Components.Schemas.Commit.ParentsPayload - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public struct StatsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. - public var additions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. - public var deletions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/total`. - public var total: Swift.Int? - /// Creates a new `StatsPayload`. + /// - Remark: Generated from `#/components/schemas/branch-protection/required_signatures`. + public var requiredSignatures: Components.Schemas.BranchProtection.RequiredSignaturesPayload? + /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// + /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch`. + public struct LockBranchPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `LockBranchPayload`. /// /// - Parameters: - /// - additions: - /// - deletions: - /// - total: - public init( - additions: Swift.Int? = nil, - deletions: Swift.Int? = nil, - total: Swift.Int? = nil - ) { - self.additions = additions - self.deletions = deletions - self.total = total + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case additions - case deletions - case total + case enabled } } - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public var stats: Components.Schemas.Commit.StatsPayload? - /// - Remark: Generated from `#/components/schemas/commit/files`. - public var files: [Components.Schemas.DiffEntry]? - /// Creates a new `Commit`. + /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// + /// - Remark: Generated from `#/components/schemas/branch-protection/lock_branch`. + public var lockBranch: Components.Schemas.BranchProtection.LockBranchPayload? + /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing`. + public struct AllowForkSyncingPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `AllowForkSyncingPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + } + /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// + /// - Remark: Generated from `#/components/schemas/branch-protection/allow_fork_syncing`. + public var allowForkSyncing: Components.Schemas.BranchProtection.AllowForkSyncingPayload? + /// Creates a new `BranchProtection`. /// /// - Parameters: /// - url: - /// - sha: - /// - nodeId: - /// - htmlUrl: - /// - commentsUrl: - /// - commit: - /// - author: - /// - committer: - /// - parents: - /// - stats: - /// - files: + /// - enabled: + /// - requiredStatusChecks: + /// - enforceAdmins: + /// - requiredPullRequestReviews: + /// - restrictions: + /// - requiredLinearHistory: + /// - allowForcePushes: + /// - allowDeletions: + /// - blockCreations: + /// - requiredConversationResolution: + /// - name: + /// - protectionUrl: + /// - requiredSignatures: + /// - lockBranch: Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// - allowForkSyncing: Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. public init( - url: Swift.String, - sha: Swift.String, - nodeId: Swift.String, - htmlUrl: Swift.String, - commentsUrl: Swift.String, - commit: Components.Schemas.Commit.CommitPayload, - author: Components.Schemas.Commit.AuthorPayload? = nil, - committer: Components.Schemas.Commit.CommitterPayload? = nil, - parents: Components.Schemas.Commit.ParentsPayload, - stats: Components.Schemas.Commit.StatsPayload? = nil, - files: [Components.Schemas.DiffEntry]? = nil + url: Swift.String? = nil, + enabled: Swift.Bool? = nil, + requiredStatusChecks: Components.Schemas.ProtectedBranchRequiredStatusCheck? = nil, + enforceAdmins: Components.Schemas.ProtectedBranchAdminEnforced? = nil, + requiredPullRequestReviews: Components.Schemas.ProtectedBranchPullRequestReview? = nil, + restrictions: Components.Schemas.BranchRestrictionPolicy? = nil, + requiredLinearHistory: Components.Schemas.BranchProtection.RequiredLinearHistoryPayload? = nil, + allowForcePushes: Components.Schemas.BranchProtection.AllowForcePushesPayload? = nil, + allowDeletions: Components.Schemas.BranchProtection.AllowDeletionsPayload? = nil, + blockCreations: Components.Schemas.BranchProtection.BlockCreationsPayload? = nil, + requiredConversationResolution: Components.Schemas.BranchProtection.RequiredConversationResolutionPayload? = nil, + name: Swift.String? = nil, + protectionUrl: Swift.String? = nil, + requiredSignatures: Components.Schemas.BranchProtection.RequiredSignaturesPayload? = nil, + lockBranch: Components.Schemas.BranchProtection.LockBranchPayload? = nil, + allowForkSyncing: Components.Schemas.BranchProtection.AllowForkSyncingPayload? = nil ) { self.url = url - self.sha = sha - self.nodeId = nodeId - self.htmlUrl = htmlUrl - self.commentsUrl = commentsUrl - self.commit = commit - self.author = author - self.committer = committer - self.parents = parents - self.stats = stats - self.files = files + self.enabled = enabled + self.requiredStatusChecks = requiredStatusChecks + self.enforceAdmins = enforceAdmins + self.requiredPullRequestReviews = requiredPullRequestReviews + self.restrictions = restrictions + self.requiredLinearHistory = requiredLinearHistory + self.allowForcePushes = allowForcePushes + self.allowDeletions = allowDeletions + self.blockCreations = blockCreations + self.requiredConversationResolution = requiredConversationResolution + self.name = name + self.protectionUrl = protectionUrl + self.requiredSignatures = requiredSignatures + self.lockBranch = lockBranch + self.allowForkSyncing = allowForkSyncing } public enum CodingKeys: String, CodingKey { case url - case sha - case nodeId = "node_id" - case htmlUrl = "html_url" - case commentsUrl = "comments_url" - case commit - case author - case committer - case parents - case stats - case files + case enabled + case requiredStatusChecks = "required_status_checks" + case enforceAdmins = "enforce_admins" + case requiredPullRequestReviews = "required_pull_request_reviews" + case restrictions + case requiredLinearHistory = "required_linear_history" + case allowForcePushes = "allow_force_pushes" + case allowDeletions = "allow_deletions" + case blockCreations = "block_creations" + case requiredConversationResolution = "required_conversation_resolution" + case name + case protectionUrl = "protection_url" + case requiredSignatures = "required_signatures" + case lockBranch = "lock_branch" + case allowForkSyncing = "allow_fork_syncing" } } - /// Branch With Protection + /// Short Branch /// - /// - Remark: Generated from `#/components/schemas/branch-with-protection`. - public struct BranchWithProtection: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-with-protection/name`. + /// - Remark: Generated from `#/components/schemas/short-branch`. + public struct ShortBranch: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/short-branch/name`. public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-with-protection/commit`. - public var commit: Components.Schemas.Commit - /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links/html`. - public var html: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links/self`. - public var _self: Swift.String - /// Creates a new `_LinksPayload`. + /// - Remark: Generated from `#/components/schemas/short-branch/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/short-branch/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/short-branch/commit/url`. + public var url: Swift.String + /// Creates a new `CommitPayload`. /// /// - Parameters: - /// - html: - /// - _self: + /// - sha: + /// - url: public init( - html: Swift.String, - _self: Swift.String + sha: Swift.String, + url: Swift.String ) { - self.html = html - self._self = _self + self.sha = sha + self.url = url } public enum CodingKeys: String, CodingKey { - case html - case _self = "self" + case sha + case url } } - /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links`. - public var _links: Components.Schemas.BranchWithProtection._LinksPayload - /// - Remark: Generated from `#/components/schemas/branch-with-protection/protected`. + /// - Remark: Generated from `#/components/schemas/short-branch/commit`. + public var commit: Components.Schemas.ShortBranch.CommitPayload + /// - Remark: Generated from `#/components/schemas/short-branch/protected`. public var protected: Swift.Bool - /// - Remark: Generated from `#/components/schemas/branch-with-protection/protection`. - public var protection: Components.Schemas.BranchProtection - /// - Remark: Generated from `#/components/schemas/branch-with-protection/protection_url`. - public var protectionUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-with-protection/pattern`. - public var pattern: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-with-protection/required_approving_review_count`. - public var requiredApprovingReviewCount: Swift.Int? - /// Creates a new `BranchWithProtection`. + /// - Remark: Generated from `#/components/schemas/short-branch/protection`. + public var protection: Components.Schemas.BranchProtection? + /// - Remark: Generated from `#/components/schemas/short-branch/protection_url`. + public var protectionUrl: Swift.String? + /// Creates a new `ShortBranch`. /// /// - Parameters: /// - name: /// - commit: - /// - _links: /// - protected: /// - protection: /// - protectionUrl: - /// - pattern: - /// - requiredApprovingReviewCount: public init( name: Swift.String, - commit: Components.Schemas.Commit, - _links: Components.Schemas.BranchWithProtection._LinksPayload, + commit: Components.Schemas.ShortBranch.CommitPayload, protected: Swift.Bool, - protection: Components.Schemas.BranchProtection, - protectionUrl: Swift.String, - pattern: Swift.String? = nil, - requiredApprovingReviewCount: Swift.Int? = nil + protection: Components.Schemas.BranchProtection? = nil, + protectionUrl: Swift.String? = nil ) { self.name = name self.commit = commit - self._links = _links self.protected = protected self.protection = protection self.protectionUrl = protectionUrl - self.pattern = pattern - self.requiredApprovingReviewCount = requiredApprovingReviewCount } public enum CodingKeys: String, CodingKey { case name case commit - case _links case protected case protection case protectionUrl = "protection_url" - case pattern - case requiredApprovingReviewCount = "required_approving_review_count" } } - /// Status Check Policy + /// Metaproperties for Git author/committer information. /// - /// - Remark: Generated from `#/components/schemas/status-check-policy`. - public struct StatusCheckPolicy: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/status-check-policy/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/status-check-policy/strict`. - public var strict: Swift.Bool - /// - Remark: Generated from `#/components/schemas/status-check-policy/contexts`. - public var contexts: [Swift.String] - /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload`. - public struct ChecksPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload/context`. - public var context: Swift.String - /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload/app_id`. - public var appId: Swift.Int? - /// Creates a new `ChecksPayloadPayload`. - /// - /// - Parameters: - /// - context: - /// - appId: - public init( - context: Swift.String, - appId: Swift.Int? = nil - ) { - self.context = context - self.appId = appId - } - public enum CodingKeys: String, CodingKey { - case context - case appId = "app_id" - } + /// - Remark: Generated from `#/components/schemas/nullable-git-user`. + public struct NullableGitUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. + public var date: Swift.String? + /// Creates a new `NullableGitUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - date: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + date: Swift.String? = nil + ) { + self.name = name + self.email = email + self.date = date } - /// - Remark: Generated from `#/components/schemas/status-check-policy/checks`. - public typealias ChecksPayload = [Components.Schemas.StatusCheckPolicy.ChecksPayloadPayload] - /// - Remark: Generated from `#/components/schemas/status-check-policy/checks`. - public var checks: Components.Schemas.StatusCheckPolicy.ChecksPayload - /// - Remark: Generated from `#/components/schemas/status-check-policy/contexts_url`. - public var contextsUrl: Swift.String - /// Creates a new `StatusCheckPolicy`. + public enum CodingKeys: String, CodingKey { + case name + case email + case date + } + } + /// - Remark: Generated from `#/components/schemas/verification`. + public struct Verification: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/verification/verified`. + public var verified: Swift.Bool + /// - Remark: Generated from `#/components/schemas/verification/reason`. + public var reason: Swift.String + /// - Remark: Generated from `#/components/schemas/verification/payload`. + public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/signature`. + public var signature: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/verified_at`. + public var verifiedAt: Swift.String? + /// Creates a new `Verification`. + /// + /// - Parameters: + /// - verified: + /// - reason: + /// - payload: + /// - signature: + /// - verifiedAt: + public init( + verified: Swift.Bool, + reason: Swift.String, + payload: Swift.String? = nil, + signature: Swift.String? = nil, + verifiedAt: Swift.String? = nil + ) { + self.verified = verified + self.reason = reason + self.payload = payload + self.signature = signature + self.verifiedAt = verifiedAt + } + public enum CodingKeys: String, CodingKey { + case verified + case reason + case payload + case signature + case verifiedAt = "verified_at" + } + } + /// Diff Entry + /// + /// - Remark: Generated from `#/components/schemas/diff-entry`. + public struct DiffEntry: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. + public var sha: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. + public var filename: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case added = "added" + case removed = "removed" + case modified = "modified" + case renamed = "renamed" + case copied = "copied" + case changed = "changed" + case unchanged = "unchanged" + } + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + public var status: Components.Schemas.DiffEntry.StatusPayload + /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. + public var additions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. + public var deletions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. + public var changes: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. + public var blobUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. + public var rawUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. + public var patch: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. + public var previousFilename: Swift.String? + /// Creates a new `DiffEntry`. /// /// - Parameters: - /// - url: - /// - strict: - /// - contexts: - /// - checks: - /// - contextsUrl: + /// - sha: + /// - filename: + /// - status: + /// - additions: + /// - deletions: + /// - changes: + /// - blobUrl: + /// - rawUrl: + /// - contentsUrl: + /// - patch: + /// - previousFilename: public init( - url: Swift.String, - strict: Swift.Bool, - contexts: [Swift.String], - checks: Components.Schemas.StatusCheckPolicy.ChecksPayload, - contextsUrl: Swift.String + sha: Swift.String? = nil, + filename: Swift.String, + status: Components.Schemas.DiffEntry.StatusPayload, + additions: Swift.Int, + deletions: Swift.Int, + changes: Swift.Int, + blobUrl: Swift.String, + rawUrl: Swift.String, + contentsUrl: Swift.String, + patch: Swift.String? = nil, + previousFilename: Swift.String? = nil ) { - self.url = url - self.strict = strict - self.contexts = contexts - self.checks = checks - self.contextsUrl = contextsUrl + self.sha = sha + self.filename = filename + self.status = status + self.additions = additions + self.deletions = deletions + self.changes = changes + self.blobUrl = blobUrl + self.rawUrl = rawUrl + self.contentsUrl = contentsUrl + self.patch = patch + self.previousFilename = previousFilename } public enum CodingKeys: String, CodingKey { - case url - case strict - case contexts - case checks - case contextsUrl = "contexts_url" + case sha + case filename + case status + case additions + case deletions + case changes + case blobUrl = "blob_url" + case rawUrl = "raw_url" + case contentsUrl = "contents_url" + case patch + case previousFilename = "previous_filename" } } - /// Branch protections protect branches + /// Commit /// - /// - Remark: Generated from `#/components/schemas/protected-branch`. - public struct ProtectedBranch: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/url`. + /// - Remark: Generated from `#/components/schemas/commit`. + public struct Commit: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_status_checks`. - public var requiredStatusChecks: Components.Schemas.StatusCheckPolicy? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews`. - public struct RequiredPullRequestReviewsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/url`. + /// - Remark: Generated from `#/components/schemas/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismiss_stale_reviews`. - public var dismissStaleReviews: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/require_code_owner_reviews`. - public var requireCodeOwnerReviews: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/required_approving_review_count`. - public var requiredApprovingReviewCount: Swift.Int? - /// Whether the most recent push must be approved by someone other than the person who pushed it. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/require_last_push_approval`. - public var requireLastPushApproval: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions`. - public struct DismissalRestrictionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/url`. + /// - Remark: Generated from `#/components/schemas/commit/commit/author`. + public var author: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. + public var committer: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. + public var commentCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public struct TreePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/users_url`. - public var usersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/teams_url`. - public var teamsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/users`. - public var users: [Components.Schemas.SimpleUser] - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/teams`. - public var teams: [Components.Schemas.Team] - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/apps`. - public var apps: [Components.Schemas.Integration]? - /// Creates a new `DismissalRestrictionsPayload`. + /// Creates a new `TreePayload`. /// /// - Parameters: + /// - sha: /// - url: - /// - usersUrl: - /// - teamsUrl: - /// - users: - /// - teams: - /// - apps: - public init( - url: Swift.String, - usersUrl: Swift.String, - teamsUrl: Swift.String, - users: [Components.Schemas.SimpleUser], - teams: [Components.Schemas.Team], - apps: [Components.Schemas.Integration]? = nil - ) { - self.url = url - self.usersUrl = usersUrl - self.teamsUrl = teamsUrl - self.users = users - self.teams = teams - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case url - case usersUrl = "users_url" - case teamsUrl = "teams_url" - case users - case teams - case apps - } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions`. - public var dismissalRestrictions: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.DismissalRestrictionsPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances`. - public struct BypassPullRequestAllowancesPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/users`. - public var users: [Components.Schemas.SimpleUser] - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/teams`. - public var teams: [Components.Schemas.Team] - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/apps`. - public var apps: [Components.Schemas.Integration]? - /// Creates a new `BypassPullRequestAllowancesPayload`. - /// - /// - Parameters: - /// - users: - /// - teams: - /// - apps: public init( - users: [Components.Schemas.SimpleUser], - teams: [Components.Schemas.Team], - apps: [Components.Schemas.Integration]? = nil + sha: Swift.String, + url: Swift.String ) { - self.users = users - self.teams = teams - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case users - case teams - case apps - } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances`. - public var bypassPullRequestAllowances: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.BypassPullRequestAllowancesPayload? - /// Creates a new `RequiredPullRequestReviewsPayload`. - /// - /// - Parameters: - /// - url: - /// - dismissStaleReviews: - /// - requireCodeOwnerReviews: - /// - requiredApprovingReviewCount: - /// - requireLastPushApproval: Whether the most recent push must be approved by someone other than the person who pushed it. - /// - dismissalRestrictions: - /// - bypassPullRequestAllowances: - public init( - url: Swift.String, - dismissStaleReviews: Swift.Bool? = nil, - requireCodeOwnerReviews: Swift.Bool? = nil, - requiredApprovingReviewCount: Swift.Int? = nil, - requireLastPushApproval: Swift.Bool? = nil, - dismissalRestrictions: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.DismissalRestrictionsPayload? = nil, - bypassPullRequestAllowances: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.BypassPullRequestAllowancesPayload? = nil - ) { - self.url = url - self.dismissStaleReviews = dismissStaleReviews - self.requireCodeOwnerReviews = requireCodeOwnerReviews - self.requiredApprovingReviewCount = requiredApprovingReviewCount - self.requireLastPushApproval = requireLastPushApproval - self.dismissalRestrictions = dismissalRestrictions - self.bypassPullRequestAllowances = bypassPullRequestAllowances - } - public enum CodingKeys: String, CodingKey { - case url - case dismissStaleReviews = "dismiss_stale_reviews" - case requireCodeOwnerReviews = "require_code_owner_reviews" - case requiredApprovingReviewCount = "required_approving_review_count" - case requireLastPushApproval = "require_last_push_approval" - case dismissalRestrictions = "dismissal_restrictions" - case bypassPullRequestAllowances = "bypass_pull_request_allowances" - } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews`. - public var requiredPullRequestReviews: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures`. - public struct RequiredSignaturesPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures/enabled`. - public var enabled: Swift.Bool - /// Creates a new `RequiredSignaturesPayload`. - /// - /// - Parameters: - /// - url: - /// - enabled: - public init( - url: Swift.String, - enabled: Swift.Bool - ) { - self.url = url - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case url - case enabled + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures`. - public var requiredSignatures: Components.Schemas.ProtectedBranch.RequiredSignaturesPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins`. - public struct EnforceAdminsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins/enabled`. - public var enabled: Swift.Bool - /// Creates a new `EnforceAdminsPayload`. + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public var tree: Components.Schemas.Commit.CommitPayload.TreePayload + /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. + public var verification: Components.Schemas.Verification? + /// Creates a new `CommitPayload`. /// /// - Parameters: /// - url: - /// - enabled: + /// - author: + /// - committer: + /// - message: + /// - commentCount: + /// - tree: + /// - verification: public init( url: Swift.String, - enabled: Swift.Bool + author: Components.Schemas.NullableGitUser? = nil, + committer: Components.Schemas.NullableGitUser? = nil, + message: Swift.String, + commentCount: Swift.Int, + tree: Components.Schemas.Commit.CommitPayload.TreePayload, + verification: Components.Schemas.Verification? = nil ) { self.url = url - self.enabled = enabled + self.author = author + self.committer = committer + self.message = message + self.commentCount = commentCount + self.tree = tree + self.verification = verification } public enum CodingKeys: String, CodingKey { case url - case enabled - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.url = try container.decode( - Swift.String.self, - forKey: .url - ) - self.enabled = try container.decode( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "url", - "enabled" - ]) + case author + case committer + case message + case commentCount = "comment_count" + case tree + case verification } } - /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins`. - public var enforceAdmins: Components.Schemas.ProtectedBranch.EnforceAdminsPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history`. - public struct RequiredLinearHistoryPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history/enabled`. - public var enabled: Swift.Bool - /// Creates a new `RequiredLinearHistoryPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public var commit: Components.Schemas.Commit.CommitPayload + /// - Remark: Generated from `#/components/schemas/commit/author`. + @frozen public enum AuthorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/author/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/author/case2`. + case EmptyObject(Components.Schemas.EmptyObject) public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decode( - Swift.Bool.self, - forKey: .enabled + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) - } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history`. - public var requiredLinearHistory: Components.Schemas.ProtectedBranch.RequiredLinearHistoryPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes`. - public struct AllowForcePushesPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes/enabled`. - public var enabled: Swift.Bool - /// Creates a new `AllowForcePushesPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decode( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } } } - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes`. - public var allowForcePushes: Components.Schemas.ProtectedBranch.AllowForcePushesPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions`. - public struct AllowDeletionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions/enabled`. - public var enabled: Swift.Bool - /// Creates a new `AllowDeletionsPayload`. - /// - /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool) { - self.enabled = enabled - } - public enum CodingKeys: String, CodingKey { - case enabled - } + /// - Remark: Generated from `#/components/schemas/commit/author`. + public var author: Components.Schemas.Commit.AuthorPayload? + /// - Remark: Generated from `#/components/schemas/commit/committer`. + @frozen public enum CommitterPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. + case EmptyObject(Components.Schemas.EmptyObject) public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decode( - Swift.Bool.self, - forKey: .enabled + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } } } - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions`. - public var allowDeletions: Components.Schemas.ProtectedBranch.AllowDeletionsPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/restrictions`. - public var restrictions: Components.Schemas.BranchRestrictionPolicy? - /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution`. - public struct RequiredConversationResolutionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `RequiredConversationResolutionPayload`. + /// - Remark: Generated from `#/components/schemas/commit/committer`. + public var committer: Components.Schemas.Commit.CommitterPayload? + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. + public struct ParentsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `ParentsPayloadPayload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled + /// - sha: + /// - url: + /// - htmlUrl: + public init( + sha: Swift.String, + url: Swift.String, + htmlUrl: Swift.String? = nil + ) { + self.sha = sha + self.url = url + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { - case enabled - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decodeIfPresent( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) - } - } - /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution`. - public var requiredConversationResolution: Components.Schemas.ProtectedBranch.RequiredConversationResolutionPayload? - /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations`. - public struct BlockCreationsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations/enabled`. - public var enabled: Swift.Bool - /// Creates a new `BlockCreationsPayload`. + case sha + case url + case htmlUrl = "html_url" + } + } + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public var parents: Components.Schemas.Commit.ParentsPayload + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public struct StatsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. + public var additions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. + public var deletions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/total`. + public var total: Swift.Int? + /// Creates a new `StatsPayload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool) { - self.enabled = enabled + /// - additions: + /// - deletions: + /// - total: + public init( + additions: Swift.Int? = nil, + deletions: Swift.Int? = nil, + total: Swift.Int? = nil + ) { + self.additions = additions + self.deletions = deletions + self.total = total } public enum CodingKeys: String, CodingKey { - case enabled - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decode( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) + case additions + case deletions + case total } } - /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations`. - public var blockCreations: Components.Schemas.ProtectedBranch.BlockCreationsPayload? - /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public var stats: Components.Schemas.Commit.StatsPayload? + /// - Remark: Generated from `#/components/schemas/commit/files`. + public var files: [Components.Schemas.DiffEntry]? + /// Creates a new `Commit`. /// - /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch`. - public struct LockBranchPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `LockBranchPayload`. + /// - Parameters: + /// - url: + /// - sha: + /// - nodeId: + /// - htmlUrl: + /// - commentsUrl: + /// - commit: + /// - author: + /// - committer: + /// - parents: + /// - stats: + /// - files: + public init( + url: Swift.String, + sha: Swift.String, + nodeId: Swift.String, + htmlUrl: Swift.String, + commentsUrl: Swift.String, + commit: Components.Schemas.Commit.CommitPayload, + author: Components.Schemas.Commit.AuthorPayload? = nil, + committer: Components.Schemas.Commit.CommitterPayload? = nil, + parents: Components.Schemas.Commit.ParentsPayload, + stats: Components.Schemas.Commit.StatsPayload? = nil, + files: [Components.Schemas.DiffEntry]? = nil + ) { + self.url = url + self.sha = sha + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.commentsUrl = commentsUrl + self.commit = commit + self.author = author + self.committer = committer + self.parents = parents + self.stats = stats + self.files = files + } + public enum CodingKeys: String, CodingKey { + case url + case sha + case nodeId = "node_id" + case htmlUrl = "html_url" + case commentsUrl = "comments_url" + case commit + case author + case committer + case parents + case stats + case files + } + } + /// Branch With Protection + /// + /// - Remark: Generated from `#/components/schemas/branch-with-protection`. + public struct BranchWithProtection: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-with-protection/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-with-protection/commit`. + public var commit: Components.Schemas.Commit + /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links/html`. + public var html: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links/self`. + public var _self: Swift.String + /// Creates a new `_LinksPayload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled + /// - html: + /// - _self: + public init( + html: Swift.String, + _self: Swift.String + ) { + self.html = html + self._self = _self } public enum CodingKeys: String, CodingKey { - case enabled - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decodeIfPresent( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) + case html + case _self = "self" } } - /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch`. - public var lockBranch: Components.Schemas.ProtectedBranch.LockBranchPayload? - /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// - Remark: Generated from `#/components/schemas/branch-with-protection/_links`. + public var _links: Components.Schemas.BranchWithProtection._LinksPayload + /// - Remark: Generated from `#/components/schemas/branch-with-protection/protected`. + public var protected: Swift.Bool + /// - Remark: Generated from `#/components/schemas/branch-with-protection/protection`. + public var protection: Components.Schemas.BranchProtection + /// - Remark: Generated from `#/components/schemas/branch-with-protection/protection_url`. + public var protectionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-with-protection/pattern`. + public var pattern: Swift.String? + /// - Remark: Generated from `#/components/schemas/branch-with-protection/required_approving_review_count`. + public var requiredApprovingReviewCount: Swift.Int? + /// Creates a new `BranchWithProtection`. /// - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing`. - public struct AllowForkSyncingPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing/enabled`. - public var enabled: Swift.Bool? - /// Creates a new `AllowForkSyncingPayload`. + /// - Parameters: + /// - name: + /// - commit: + /// - _links: + /// - protected: + /// - protection: + /// - protectionUrl: + /// - pattern: + /// - requiredApprovingReviewCount: + public init( + name: Swift.String, + commit: Components.Schemas.Commit, + _links: Components.Schemas.BranchWithProtection._LinksPayload, + protected: Swift.Bool, + protection: Components.Schemas.BranchProtection, + protectionUrl: Swift.String, + pattern: Swift.String? = nil, + requiredApprovingReviewCount: Swift.Int? = nil + ) { + self.name = name + self.commit = commit + self._links = _links + self.protected = protected + self.protection = protection + self.protectionUrl = protectionUrl + self.pattern = pattern + self.requiredApprovingReviewCount = requiredApprovingReviewCount + } + public enum CodingKeys: String, CodingKey { + case name + case commit + case _links + case protected + case protection + case protectionUrl = "protection_url" + case pattern + case requiredApprovingReviewCount = "required_approving_review_count" + } + } + /// Status Check Policy + /// + /// - Remark: Generated from `#/components/schemas/status-check-policy`. + public struct StatusCheckPolicy: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/status-check-policy/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/status-check-policy/strict`. + public var strict: Swift.Bool + /// - Remark: Generated from `#/components/schemas/status-check-policy/contexts`. + public var contexts: [Swift.String] + /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload`. + public struct ChecksPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload/context`. + public var context: Swift.String + /// - Remark: Generated from `#/components/schemas/status-check-policy/ChecksPayload/app_id`. + public var appId: Swift.Int? + /// Creates a new `ChecksPayloadPayload`. /// /// - Parameters: - /// - enabled: - public init(enabled: Swift.Bool? = nil) { - self.enabled = enabled + /// - context: + /// - appId: + public init( + context: Swift.String, + appId: Swift.Int? = nil + ) { + self.context = context + self.appId = appId } public enum CodingKeys: String, CodingKey { - case enabled - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.enabled = try container.decodeIfPresent( - Swift.Bool.self, - forKey: .enabled - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "enabled" - ]) + case context + case appId = "app_id" } } - /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. - /// - /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing`. - public var allowForkSyncing: Components.Schemas.ProtectedBranch.AllowForkSyncingPayload? - /// Creates a new `ProtectedBranch`. + /// - Remark: Generated from `#/components/schemas/status-check-policy/checks`. + public typealias ChecksPayload = [Components.Schemas.StatusCheckPolicy.ChecksPayloadPayload] + /// - Remark: Generated from `#/components/schemas/status-check-policy/checks`. + public var checks: Components.Schemas.StatusCheckPolicy.ChecksPayload + /// - Remark: Generated from `#/components/schemas/status-check-policy/contexts_url`. + public var contextsUrl: Swift.String + /// Creates a new `StatusCheckPolicy`. /// /// - Parameters: /// - url: - /// - requiredStatusChecks: - /// - requiredPullRequestReviews: - /// - requiredSignatures: - /// - enforceAdmins: - /// - requiredLinearHistory: - /// - allowForcePushes: - /// - allowDeletions: - /// - restrictions: - /// - requiredConversationResolution: - /// - blockCreations: - /// - lockBranch: Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. - /// - allowForkSyncing: Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// - strict: + /// - contexts: + /// - checks: + /// - contextsUrl: public init( url: Swift.String, - requiredStatusChecks: Components.Schemas.StatusCheckPolicy? = nil, - requiredPullRequestReviews: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload? = nil, - requiredSignatures: Components.Schemas.ProtectedBranch.RequiredSignaturesPayload? = nil, - enforceAdmins: Components.Schemas.ProtectedBranch.EnforceAdminsPayload? = nil, - requiredLinearHistory: Components.Schemas.ProtectedBranch.RequiredLinearHistoryPayload? = nil, - allowForcePushes: Components.Schemas.ProtectedBranch.AllowForcePushesPayload? = nil, - allowDeletions: Components.Schemas.ProtectedBranch.AllowDeletionsPayload? = nil, - restrictions: Components.Schemas.BranchRestrictionPolicy? = nil, - requiredConversationResolution: Components.Schemas.ProtectedBranch.RequiredConversationResolutionPayload? = nil, - blockCreations: Components.Schemas.ProtectedBranch.BlockCreationsPayload? = nil, - lockBranch: Components.Schemas.ProtectedBranch.LockBranchPayload? = nil, - allowForkSyncing: Components.Schemas.ProtectedBranch.AllowForkSyncingPayload? = nil + strict: Swift.Bool, + contexts: [Swift.String], + checks: Components.Schemas.StatusCheckPolicy.ChecksPayload, + contextsUrl: Swift.String ) { self.url = url - self.requiredStatusChecks = requiredStatusChecks - self.requiredPullRequestReviews = requiredPullRequestReviews - self.requiredSignatures = requiredSignatures - self.enforceAdmins = enforceAdmins - self.requiredLinearHistory = requiredLinearHistory - self.allowForcePushes = allowForcePushes - self.allowDeletions = allowDeletions - self.restrictions = restrictions - self.requiredConversationResolution = requiredConversationResolution - self.blockCreations = blockCreations - self.lockBranch = lockBranch - self.allowForkSyncing = allowForkSyncing + self.strict = strict + self.contexts = contexts + self.checks = checks + self.contextsUrl = contextsUrl } public enum CodingKeys: String, CodingKey { case url - case requiredStatusChecks = "required_status_checks" - case requiredPullRequestReviews = "required_pull_request_reviews" - case requiredSignatures = "required_signatures" - case enforceAdmins = "enforce_admins" - case requiredLinearHistory = "required_linear_history" - case allowForcePushes = "allow_force_pushes" - case allowDeletions = "allow_deletions" - case restrictions - case requiredConversationResolution = "required_conversation_resolution" - case blockCreations = "block_creations" - case lockBranch = "lock_branch" - case allowForkSyncing = "allow_fork_syncing" + case strict + case contexts + case checks + case contextsUrl = "contexts_url" } } - /// A list of errors found in a repo's CODEOWNERS file + /// Branch protections protect branches /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors`. - public struct CodeownersErrors: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// The line number where this errors occurs. - /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/line`. - public var line: Swift.Int - /// The column number where this errors occurs. - /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/column`. - public var column: Swift.Int - /// The contents of the line where the error occurs. - /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/source`. - public var source: Swift.String? - /// The type of error. - /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/kind`. - public var kind: Swift.String - /// Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. - /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/suggestion`. - public var suggestion: Swift.String? - /// A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). + /// - Remark: Generated from `#/components/schemas/protected-branch`. + public struct ProtectedBranch: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_status_checks`. + public var requiredStatusChecks: Components.Schemas.StatusCheckPolicy? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews`. + public struct RequiredPullRequestReviewsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismiss_stale_reviews`. + public var dismissStaleReviews: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/require_code_owner_reviews`. + public var requireCodeOwnerReviews: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/required_approving_review_count`. + public var requiredApprovingReviewCount: Swift.Int? + /// Whether the most recent push must be approved by someone other than the person who pushed it. /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/message`. - public var message: Swift.String - /// The path of the file where the error occured. + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/require_last_push_approval`. + public var requireLastPushApproval: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions`. + public struct DismissalRestrictionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/users_url`. + public var usersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/users`. + public var users: [Components.Schemas.SimpleUser] + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/teams`. + public var teams: [Components.Schemas.Team] + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions/apps`. + public var apps: [Components.Schemas.Integration]? + /// Creates a new `DismissalRestrictionsPayload`. + /// + /// - Parameters: + /// - url: + /// - usersUrl: + /// - teamsUrl: + /// - users: + /// - teams: + /// - apps: + public init( + url: Swift.String, + usersUrl: Swift.String, + teamsUrl: Swift.String, + users: [Components.Schemas.SimpleUser], + teams: [Components.Schemas.Team], + apps: [Components.Schemas.Integration]? = nil + ) { + self.url = url + self.usersUrl = usersUrl + self.teamsUrl = teamsUrl + self.users = users + self.teams = teams + self.apps = apps + } + public enum CodingKeys: String, CodingKey { + case url + case usersUrl = "users_url" + case teamsUrl = "teams_url" + case users + case teams + case apps + } + } + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/dismissal_restrictions`. + public var dismissalRestrictions: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.DismissalRestrictionsPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances`. + public struct BypassPullRequestAllowancesPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/users`. + public var users: [Components.Schemas.SimpleUser] + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/teams`. + public var teams: [Components.Schemas.Team] + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances/apps`. + public var apps: [Components.Schemas.Integration]? + /// Creates a new `BypassPullRequestAllowancesPayload`. + /// + /// - Parameters: + /// - users: + /// - teams: + /// - apps: + public init( + users: [Components.Schemas.SimpleUser], + teams: [Components.Schemas.Team], + apps: [Components.Schemas.Integration]? = nil + ) { + self.users = users + self.teams = teams + self.apps = apps + } + public enum CodingKeys: String, CodingKey { + case users + case teams + case apps + } + } + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews/bypass_pull_request_allowances`. + public var bypassPullRequestAllowances: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.BypassPullRequestAllowancesPayload? + /// Creates a new `RequiredPullRequestReviewsPayload`. /// - /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/path`. - public var path: Swift.String - /// Creates a new `ErrorsPayloadPayload`. + /// - Parameters: + /// - url: + /// - dismissStaleReviews: + /// - requireCodeOwnerReviews: + /// - requiredApprovingReviewCount: + /// - requireLastPushApproval: Whether the most recent push must be approved by someone other than the person who pushed it. + /// - dismissalRestrictions: + /// - bypassPullRequestAllowances: + public init( + url: Swift.String, + dismissStaleReviews: Swift.Bool? = nil, + requireCodeOwnerReviews: Swift.Bool? = nil, + requiredApprovingReviewCount: Swift.Int? = nil, + requireLastPushApproval: Swift.Bool? = nil, + dismissalRestrictions: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.DismissalRestrictionsPayload? = nil, + bypassPullRequestAllowances: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload.BypassPullRequestAllowancesPayload? = nil + ) { + self.url = url + self.dismissStaleReviews = dismissStaleReviews + self.requireCodeOwnerReviews = requireCodeOwnerReviews + self.requiredApprovingReviewCount = requiredApprovingReviewCount + self.requireLastPushApproval = requireLastPushApproval + self.dismissalRestrictions = dismissalRestrictions + self.bypassPullRequestAllowances = bypassPullRequestAllowances + } + public enum CodingKeys: String, CodingKey { + case url + case dismissStaleReviews = "dismiss_stale_reviews" + case requireCodeOwnerReviews = "require_code_owner_reviews" + case requiredApprovingReviewCount = "required_approving_review_count" + case requireLastPushApproval = "require_last_push_approval" + case dismissalRestrictions = "dismissal_restrictions" + case bypassPullRequestAllowances = "bypass_pull_request_allowances" + } + } + /// - Remark: Generated from `#/components/schemas/protected-branch/required_pull_request_reviews`. + public var requiredPullRequestReviews: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures`. + public struct RequiredSignaturesPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures/enabled`. + public var enabled: Swift.Bool + /// Creates a new `RequiredSignaturesPayload`. /// /// - Parameters: - /// - line: The line number where this errors occurs. - /// - column: The column number where this errors occurs. - /// - source: The contents of the line where the error occurs. - /// - kind: The type of error. - /// - suggestion: Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. - /// - message: A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). - /// - path: The path of the file where the error occured. + /// - url: + /// - enabled: public init( - line: Swift.Int, - column: Swift.Int, - source: Swift.String? = nil, - kind: Swift.String, - suggestion: Swift.String? = nil, - message: Swift.String, - path: Swift.String + url: Swift.String, + enabled: Swift.Bool ) { - self.line = line - self.column = column - self.source = source - self.kind = kind - self.suggestion = suggestion - self.message = message - self.path = path + self.url = url + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case line - case column - case source - case kind - case suggestion - case message - case path + case url + case enabled } } - /// - Remark: Generated from `#/components/schemas/codeowners-errors/errors`. - public typealias ErrorsPayload = [Components.Schemas.CodeownersErrors.ErrorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/codeowners-errors/errors`. - public var errors: Components.Schemas.CodeownersErrors.ErrorsPayload - /// Creates a new `CodeownersErrors`. - /// - /// - Parameters: - /// - errors: - public init(errors: Components.Schemas.CodeownersErrors.ErrorsPayload) { - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case errors - } - } - /// Collaborator - /// - /// - Remark: Generated from `#/components/schemas/collaborator`. - public struct Collaborator: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/collaborator/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/collaborator/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/collaborator/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/collaborator/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/gravatar_id`. - public var gravatarId: Swift.String? - /// - Remark: Generated from `#/components/schemas/collaborator/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/followers_url`. - public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/following_url`. - public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/gists_url`. - public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/starred_url`. - public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/subscriptions_url`. - public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/organizations_url`. - public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/received_events_url`. - public var receivedEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/site_admin`. - public var siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/collaborator/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/collaborator/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/collaborator/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/collaborator/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/collaborator/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/collaborator/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `PermissionsPayload`. + /// - Remark: Generated from `#/components/schemas/protected-branch/required_signatures`. + public var requiredSignatures: Components.Schemas.ProtectedBranch.RequiredSignaturesPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins`. + public struct EnforceAdminsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins/enabled`. + public var enabled: Swift.Bool + /// Creates a new `EnforceAdminsPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: + /// - url: + /// - enabled: public init( - pull: Swift.Bool, - triage: Swift.Bool? = nil, - push: Swift.Bool, - maintain: Swift.Bool? = nil, - admin: Swift.Bool + url: Swift.String, + enabled: Swift.Bool ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + self.url = url + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case url + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.url = try container.decode( + Swift.String.self, + forKey: .url + ) + self.enabled = try container.decode( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "url", + "enabled" + ]) } } - /// - Remark: Generated from `#/components/schemas/collaborator/permissions`. - public var permissions: Components.Schemas.Collaborator.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/collaborator/role_name`. - public var roleName: Swift.String - /// - Remark: Generated from `#/components/schemas/collaborator/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `Collaborator`. - /// - /// - Parameters: - /// - login: - /// - id: - /// - email: - /// - name: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: - /// - url: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - reposUrl: - /// - eventsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - permissions: - /// - roleName: - /// - userViewType: - public init( - login: Swift.String, - id: Swift.Int64, - email: Swift.String? = nil, - name: Swift.String? = nil, - 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, - permissions: Components.Schemas.Collaborator.PermissionsPayload? = nil, - roleName: Swift.String, - userViewType: Swift.String? = nil - ) { - self.login = login - self.id = id - self.email = email - self.name = name - 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.permissions = permissions - self.roleName = roleName - self.userViewType = userViewType - } - public enum CodingKeys: String, CodingKey { - case login - case id - case email - case name - 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 permissions - case roleName = "role_name" - case userViewType = "user_view_type" - } - } - /// Repository invitations let you manage who you collaborate with. - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation`. - public struct RepositoryInvitation: Codable, Hashable, Sendable { - /// Unique identifier of the repository invitation. - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/repository-invitation/repository`. - public var repository: Components.Schemas.MinimalRepository - /// - Remark: Generated from `#/components/schemas/repository-invitation/invitee`. - public var invitee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/repository-invitation/inviter`. - public var inviter: Components.Schemas.NullableSimpleUser? - /// The permission associated with the invitation. - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation/permissions`. - @frozen public enum PermissionsPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case triage = "triage" - case maintain = "maintain" + /// - Remark: Generated from `#/components/schemas/protected-branch/enforce_admins`. + public var enforceAdmins: Components.Schemas.ProtectedBranch.EnforceAdminsPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history`. + public struct RequiredLinearHistoryPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history/enabled`. + public var enabled: Swift.Bool + /// Creates a new `RequiredLinearHistoryPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decode( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) + } } - /// The permission associated with the invitation. - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation/permissions`. - public var permissions: Components.Schemas.RepositoryInvitation.PermissionsPayload - /// - Remark: Generated from `#/components/schemas/repository-invitation/created_at`. - public var createdAt: Foundation.Date - /// Whether or not the invitation has expired - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation/expired`. - public var expired: Swift.Bool? - /// URL for the repository invitation - /// - /// - Remark: Generated from `#/components/schemas/repository-invitation/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-invitation/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-invitation/node_id`. - public var nodeId: Swift.String - /// Creates a new `RepositoryInvitation`. - /// - /// - Parameters: - /// - id: Unique identifier of the repository invitation. - /// - repository: - /// - invitee: - /// - inviter: - /// - permissions: The permission associated with the invitation. - /// - createdAt: - /// - expired: Whether or not the invitation has expired - /// - url: URL for the repository invitation - /// - htmlUrl: - /// - nodeId: - public init( - id: Swift.Int64, - repository: Components.Schemas.MinimalRepository, - invitee: Components.Schemas.NullableSimpleUser? = nil, - inviter: Components.Schemas.NullableSimpleUser? = nil, - permissions: Components.Schemas.RepositoryInvitation.PermissionsPayload, - createdAt: Foundation.Date, - expired: Swift.Bool? = nil, - url: Swift.String, - htmlUrl: Swift.String, - nodeId: Swift.String - ) { - self.id = id - self.repository = repository - self.invitee = invitee - self.inviter = inviter - self.permissions = permissions - self.createdAt = createdAt - self.expired = expired - self.url = url - self.htmlUrl = htmlUrl - self.nodeId = nodeId + /// - Remark: Generated from `#/components/schemas/protected-branch/required_linear_history`. + public var requiredLinearHistory: Components.Schemas.ProtectedBranch.RequiredLinearHistoryPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes`. + public struct AllowForcePushesPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes/enabled`. + public var enabled: Swift.Bool + /// Creates a new `AllowForcePushesPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decode( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) + } } - public enum CodingKeys: String, CodingKey { - case id - case repository - case invitee - case inviter - case permissions - case createdAt = "created_at" - case expired - case url - case htmlUrl = "html_url" - case nodeId = "node_id" + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_force_pushes`. + public var allowForcePushes: Components.Schemas.ProtectedBranch.AllowForcePushesPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions`. + public struct AllowDeletionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions/enabled`. + public var enabled: Swift.Bool + /// Creates a new `AllowDeletionsPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decode( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) + } } - } - /// Collaborator - /// - /// - Remark: Generated from `#/components/schemas/nullable-collaborator`. - public struct NullableCollaborator: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/gravatar_id`. - public var gravatarId: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/followers_url`. - public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/following_url`. - public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/gists_url`. - public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/starred_url`. - public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/subscriptions_url`. - public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/organizations_url`. - public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/received_events_url`. - public var receivedEventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/site_admin`. - public var siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `PermissionsPayload`. + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_deletions`. + public var allowDeletions: Components.Schemas.ProtectedBranch.AllowDeletionsPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/restrictions`. + public var restrictions: Components.Schemas.BranchRestrictionPolicy? + /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution`. + public struct RequiredConversationResolutionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `RequiredConversationResolutionPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decodeIfPresent( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) + } + } + /// - Remark: Generated from `#/components/schemas/protected-branch/required_conversation_resolution`. + public var requiredConversationResolution: Components.Schemas.ProtectedBranch.RequiredConversationResolutionPayload? + /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations`. + public struct BlockCreationsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations/enabled`. + public var enabled: Swift.Bool + /// Creates a new `BlockCreationsPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool? = nil, - push: Swift.Bool, - maintain: Swift.Bool? = nil, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + /// - enabled: + public init(enabled: Swift.Bool) { + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decode( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) } } - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions`. - public var permissions: Components.Schemas.NullableCollaborator.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/role_name`. - public var roleName: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-collaborator/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `NullableCollaborator`. - /// - /// - Parameters: - /// - login: - /// - id: - /// - email: - /// - name: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: - /// - url: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - reposUrl: - /// - eventsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - permissions: - /// - roleName: - /// - userViewType: - public init( - login: Swift.String, - id: Swift.Int64, - email: Swift.String? = nil, - name: Swift.String? = nil, - 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, - permissions: Components.Schemas.NullableCollaborator.PermissionsPayload? = nil, - roleName: Swift.String, - userViewType: Swift.String? = nil - ) { - self.login = login - self.id = id - self.email = email - self.name = name - 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.permissions = permissions - self.roleName = roleName - self.userViewType = userViewType - } - public enum CodingKeys: String, CodingKey { - case login - case id - case email - case name - 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 permissions - case roleName = "role_name" - case userViewType = "user_view_type" - } - } - /// Repository Collaborator Permission - /// - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission`. - public struct RepositoryCollaboratorPermission: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/role_name`. - public var roleName: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/user`. - public var user: Components.Schemas.NullableCollaborator? - /// Creates a new `RepositoryCollaboratorPermission`. - /// - /// - Parameters: - /// - permission: - /// - roleName: - /// - user: - public init( - permission: Swift.String, - roleName: Swift.String, - user: Components.Schemas.NullableCollaborator? = nil - ) { - self.permission = permission - self.roleName = roleName - self.user = user - } - public enum CodingKeys: String, CodingKey { - case permission - case roleName = "role_name" - case user - } - } - /// Commit Comment - /// - /// - Remark: Generated from `#/components/schemas/commit-comment`. - public struct CommitComment: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit-comment/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/commit-comment/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/body`. - public var body: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/path`. - public var path: Swift.String? - /// - Remark: Generated from `#/components/schemas/commit-comment/position`. - public var position: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit-comment/line`. - public var line: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit-comment/commit_id`. - public var commitId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/commit-comment/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/commit-comment/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/commit-comment/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/commit-comment/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// Creates a new `CommitComment`. - /// - /// - Parameters: - /// - htmlUrl: - /// - url: - /// - id: - /// - nodeId: - /// - body: - /// - path: - /// - position: - /// - line: - /// - commitId: - /// - user: - /// - createdAt: - /// - updatedAt: - /// - authorAssociation: - /// - reactions: - public init( - htmlUrl: Swift.String, - url: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - body: Swift.String, - path: Swift.String? = nil, - position: Swift.Int? = nil, - line: Swift.Int? = nil, - commitId: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - authorAssociation: Components.Schemas.AuthorAssociation, - reactions: Components.Schemas.ReactionRollup? = nil - ) { - self.htmlUrl = htmlUrl - self.url = url - self.id = id - self.nodeId = nodeId - self.body = body - self.path = path - self.position = position - self.line = line - self.commitId = commitId - self.user = user - self.createdAt = createdAt - self.updatedAt = updatedAt - self.authorAssociation = authorAssociation - self.reactions = reactions - } - public enum CodingKeys: String, CodingKey { - case htmlUrl = "html_url" - case url - case id - case nodeId = "node_id" - case body - case path - case position - case line - case commitId = "commit_id" - case user - case createdAt = "created_at" - case updatedAt = "updated_at" - case authorAssociation = "author_association" - case reactions + /// - Remark: Generated from `#/components/schemas/protected-branch/block_creations`. + public var blockCreations: Components.Schemas.ProtectedBranch.BlockCreationsPayload? + /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch`. + public struct LockBranchPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `LockBranchPayload`. + /// + /// - Parameters: + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decodeIfPresent( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) + } } - } - /// Branch Short - /// - /// - Remark: Generated from `#/components/schemas/branch-short`. - public struct BranchShort: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-short/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-short/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-short/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-short/commit/url`. - public var url: Swift.String - /// Creates a new `CommitPayload`. + /// Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch/lock_branch`. + public var lockBranch: Components.Schemas.ProtectedBranch.LockBranchPayload? + /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing`. + public struct AllowForkSyncingPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing/enabled`. + public var enabled: Swift.Bool? + /// Creates a new `AllowForkSyncingPayload`. /// /// - Parameters: - /// - sha: - /// - url: - public init( - sha: Swift.String, - url: Swift.String - ) { - self.sha = sha - self.url = url + /// - enabled: + public init(enabled: Swift.Bool? = nil) { + self.enabled = enabled } public enum CodingKeys: String, CodingKey { - case sha - case url + case enabled + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.enabled = try container.decodeIfPresent( + Swift.Bool.self, + forKey: .enabled + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "enabled" + ]) } } - /// - Remark: Generated from `#/components/schemas/branch-short/commit`. - public var commit: Components.Schemas.BranchShort.CommitPayload - /// - Remark: Generated from `#/components/schemas/branch-short/protected`. - public var protected: Swift.Bool - /// Creates a new `BranchShort`. + /// Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + /// + /// - Remark: Generated from `#/components/schemas/protected-branch/allow_fork_syncing`. + public var allowForkSyncing: Components.Schemas.ProtectedBranch.AllowForkSyncingPayload? + /// Creates a new `ProtectedBranch`. /// /// - Parameters: - /// - name: - /// - commit: - /// - protected: + /// - url: + /// - requiredStatusChecks: + /// - requiredPullRequestReviews: + /// - requiredSignatures: + /// - enforceAdmins: + /// - requiredLinearHistory: + /// - allowForcePushes: + /// - allowDeletions: + /// - restrictions: + /// - requiredConversationResolution: + /// - blockCreations: + /// - lockBranch: Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + /// - allowForkSyncing: Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. public init( - name: Swift.String, - commit: Components.Schemas.BranchShort.CommitPayload, - protected: Swift.Bool + url: Swift.String, + requiredStatusChecks: Components.Schemas.StatusCheckPolicy? = nil, + requiredPullRequestReviews: Components.Schemas.ProtectedBranch.RequiredPullRequestReviewsPayload? = nil, + requiredSignatures: Components.Schemas.ProtectedBranch.RequiredSignaturesPayload? = nil, + enforceAdmins: Components.Schemas.ProtectedBranch.EnforceAdminsPayload? = nil, + requiredLinearHistory: Components.Schemas.ProtectedBranch.RequiredLinearHistoryPayload? = nil, + allowForcePushes: Components.Schemas.ProtectedBranch.AllowForcePushesPayload? = nil, + allowDeletions: Components.Schemas.ProtectedBranch.AllowDeletionsPayload? = nil, + restrictions: Components.Schemas.BranchRestrictionPolicy? = nil, + requiredConversationResolution: Components.Schemas.ProtectedBranch.RequiredConversationResolutionPayload? = nil, + blockCreations: Components.Schemas.ProtectedBranch.BlockCreationsPayload? = nil, + lockBranch: Components.Schemas.ProtectedBranch.LockBranchPayload? = nil, + allowForkSyncing: Components.Schemas.ProtectedBranch.AllowForkSyncingPayload? = nil ) { - self.name = name - self.commit = commit - self.protected = protected - } - public enum CodingKeys: String, CodingKey { - case name - case commit - case protected - } - } - /// Hypermedia Link - /// - /// - Remark: Generated from `#/components/schemas/link`. - public struct Link: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link/href`. - public var href: Swift.String - /// Creates a new `Link`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href + self.url = url + self.requiredStatusChecks = requiredStatusChecks + self.requiredPullRequestReviews = requiredPullRequestReviews + self.requiredSignatures = requiredSignatures + self.enforceAdmins = enforceAdmins + self.requiredLinearHistory = requiredLinearHistory + self.allowForcePushes = allowForcePushes + self.allowDeletions = allowDeletions + self.restrictions = restrictions + self.requiredConversationResolution = requiredConversationResolution + self.blockCreations = blockCreations + self.lockBranch = lockBranch + self.allowForkSyncing = allowForkSyncing } public enum CodingKeys: String, CodingKey { - case href + case url + case requiredStatusChecks = "required_status_checks" + case requiredPullRequestReviews = "required_pull_request_reviews" + case requiredSignatures = "required_signatures" + case enforceAdmins = "enforce_admins" + case requiredLinearHistory = "required_linear_history" + case allowForcePushes = "allow_force_pushes" + case allowDeletions = "allow_deletions" + case restrictions + case requiredConversationResolution = "required_conversation_resolution" + case blockCreations = "block_creations" + case lockBranch = "lock_branch" + case allowForkSyncing = "allow_fork_syncing" } } - /// The status of auto merging a pull request. + /// A list of errors found in a repo's CODEOWNERS file /// - /// - Remark: Generated from `#/components/schemas/auto-merge`. - public struct AutoMerge: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. - public var enabledBy: Components.Schemas.SimpleUser - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" + /// - Remark: Generated from `#/components/schemas/codeowners-errors`. + public struct CodeownersErrors: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// The line number where this errors occurs. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/line`. + public var line: Swift.Int + /// The column number where this errors occurs. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/column`. + public var column: Swift.Int + /// The contents of the line where the error occurs. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/source`. + public var source: Swift.String? + /// The type of error. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/kind`. + public var kind: Swift.String + /// Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/suggestion`. + public var suggestion: Swift.String? + /// A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/message`. + public var message: Swift.String + /// The path of the file where the error occured. + /// + /// - Remark: Generated from `#/components/schemas/codeowners-errors/ErrorsPayload/path`. + public var path: Swift.String + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - line: The line number where this errors occurs. + /// - column: The column number where this errors occurs. + /// - source: The contents of the line where the error occurs. + /// - kind: The type of error. + /// - suggestion: Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. + /// - message: A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). + /// - path: The path of the file where the error occured. + public init( + line: Swift.Int, + column: Swift.Int, + source: Swift.String? = nil, + kind: Swift.String, + suggestion: Swift.String? = nil, + message: Swift.String, + path: Swift.String + ) { + self.line = line + self.column = column + self.source = source + self.kind = kind + self.suggestion = suggestion + self.message = message + self.path = path + } + public enum CodingKeys: String, CodingKey { + case line + case column + case source + case kind + case suggestion + case message + case path + } } - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload - /// Title for the merge commit message. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. - public var commitTitle: Swift.String - /// Commit message for the merge commit. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. - public var commitMessage: Swift.String - /// Creates a new `AutoMerge`. + /// - Remark: Generated from `#/components/schemas/codeowners-errors/errors`. + public typealias ErrorsPayload = [Components.Schemas.CodeownersErrors.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/codeowners-errors/errors`. + public var errors: Components.Schemas.CodeownersErrors.ErrorsPayload + /// Creates a new `CodeownersErrors`. /// /// - Parameters: - /// - enabledBy: - /// - mergeMethod: The merge method to use. - /// - commitTitle: Title for the merge commit message. - /// - commitMessage: Commit message for the merge commit. - public init( - enabledBy: Components.Schemas.SimpleUser, - mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, - commitTitle: Swift.String, - commitMessage: Swift.String - ) { - self.enabledBy = enabledBy - self.mergeMethod = mergeMethod - self.commitTitle = commitTitle - self.commitMessage = commitMessage + /// - errors: + public init(errors: Components.Schemas.CodeownersErrors.ErrorsPayload) { + self.errors = errors } public enum CodingKeys: String, CodingKey { - case enabledBy = "enabled_by" - case mergeMethod = "merge_method" - case commitTitle = "commit_title" - case commitMessage = "commit_message" + case errors } } - /// Pull Request Simple + /// Collaborator /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple`. - public struct PullRequestSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + /// - Remark: Generated from `#/components/schemas/collaborator`. + public struct Collaborator: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/collaborator/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/id`. public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/collaborator/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/collaborator/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/collaborator/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + /// - Remark: Generated from `#/components/schemas/collaborator/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/collaborator/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. - public var diffUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. - public var patchUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. - public var reviewCommentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. - public var reviewCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. - public var locked: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. - public var description: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. - public var color: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. - public var _default: Swift.Bool - /// Creates a new `LabelsPayloadPayload`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - name: - /// - description: - /// - color: - /// - _default: - public init( - id: Swift.Int64, - nodeId: Swift.String, - url: Swift.String, - name: Swift.String, - description: Swift.String, - color: Swift.String, - _default: Swift.Bool - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case name - case description - case color - case _default = "default" - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public var labels: Components.Schemas.PullRequestSimple.LabelsPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. - public var milestone: Components.Schemas.NullableMilestone? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. - public var activeLockReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. - public var mergedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. - public var mergeCommitSha: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. - public var assignees: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. - public var requestedReviewers: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. - public var requestedTeams: [Components.Schemas.Team]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public var head: Components.Schemas.PullRequestSimple.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `BasePayload`. + /// - Remark: Generated from `#/components/schemas/collaborator/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/collaborator/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/collaborator/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/collaborator/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/collaborator/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/collaborator/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/collaborator/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil, + admin: Swift.Bool ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user + case pull + case triage + case push + case maintain + case admin } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public var base: Components.Schemas.PullRequestSimple.BasePayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. - public var comments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. - public var commits: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. - public var statuses: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. - public var html: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. - public var issue: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. - public var reviewComments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. - public var reviewComment: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. - public var _self: Components.Schemas.Link - /// Creates a new `_LinksPayload`. + /// - Remark: Generated from `#/components/schemas/collaborator/permissions`. + public var permissions: Components.Schemas.Collaborator.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/collaborator/role_name`. + public var roleName: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `Collaborator`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - email: + /// - name: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - permissions: + /// - roleName: + /// - userViewType: + public init( + login: Swift.String, + id: Swift.Int64, + email: Swift.String? = nil, + name: Swift.String? = nil, + 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, + permissions: Components.Schemas.Collaborator.PermissionsPayload? = nil, + roleName: Swift.String, + userViewType: Swift.String? = nil + ) { + self.login = login + self.id = id + self.email = email + self.name = name + 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.permissions = permissions + self.roleName = roleName + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case login + case id + case email + case name + 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 permissions + case roleName = "role_name" + case userViewType = "user_view_type" + } + } + /// Repository invitations let you manage who you collaborate with. + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation`. + public struct RepositoryInvitation: Codable, Hashable, Sendable { + /// Unique identifier of the repository invitation. + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/repository-invitation/repository`. + public var repository: Components.Schemas.MinimalRepository + /// - Remark: Generated from `#/components/schemas/repository-invitation/invitee`. + public var invitee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/repository-invitation/inviter`. + public var inviter: Components.Schemas.NullableSimpleUser? + /// The permission associated with the invitation. + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation/permissions`. + @frozen public enum PermissionsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case triage = "triage" + case maintain = "maintain" + } + /// The permission associated with the invitation. + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation/permissions`. + public var permissions: Components.Schemas.RepositoryInvitation.PermissionsPayload + /// - Remark: Generated from `#/components/schemas/repository-invitation/created_at`. + public var createdAt: Foundation.Date + /// Whether or not the invitation has expired + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation/expired`. + public var expired: Swift.Bool? + /// URL for the repository invitation + /// + /// - Remark: Generated from `#/components/schemas/repository-invitation/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-invitation/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-invitation/node_id`. + public var nodeId: Swift.String + /// Creates a new `RepositoryInvitation`. + /// + /// - Parameters: + /// - id: Unique identifier of the repository invitation. + /// - repository: + /// - invitee: + /// - inviter: + /// - permissions: The permission associated with the invitation. + /// - createdAt: + /// - expired: Whether or not the invitation has expired + /// - url: URL for the repository invitation + /// - htmlUrl: + /// - nodeId: + public init( + id: Swift.Int64, + repository: Components.Schemas.MinimalRepository, + invitee: Components.Schemas.NullableSimpleUser? = nil, + inviter: Components.Schemas.NullableSimpleUser? = nil, + permissions: Components.Schemas.RepositoryInvitation.PermissionsPayload, + createdAt: Foundation.Date, + expired: Swift.Bool? = nil, + url: Swift.String, + htmlUrl: Swift.String, + nodeId: Swift.String + ) { + self.id = id + self.repository = repository + self.invitee = invitee + self.inviter = inviter + self.permissions = permissions + self.createdAt = createdAt + self.expired = expired + self.url = url + self.htmlUrl = htmlUrl + self.nodeId = nodeId + } + public enum CodingKeys: String, CodingKey { + case id + case repository + case invitee + case inviter + case permissions + case createdAt = "created_at" + case expired + case url + case htmlUrl = "html_url" + case nodeId = "node_id" + } + } + /// Collaborator + /// + /// - Remark: Generated from `#/components/schemas/nullable-collaborator`. + public struct NullableCollaborator: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - comments: - /// - commits: - /// - statuses: - /// - html: - /// - issue: - /// - reviewComments: - /// - reviewComment: - /// - _self: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - comments: Components.Schemas.Link, - commits: Components.Schemas.Link, - statuses: Components.Schemas.Link, - html: Components.Schemas.Link, - issue: Components.Schemas.Link, - reviewComments: Components.Schemas.Link, - reviewComment: Components.Schemas.Link, - _self: Components.Schemas.Link + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil, + admin: Swift.Bool ) { - self.comments = comments - self.commits = commits - self.statuses = statuses - self.html = html - self.issue = issue - self.reviewComments = reviewComments - self.reviewComment = reviewComment - self._self = _self + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case comments - case commits - case statuses - case html - case issue - case reviewComments = "review_comments" - case reviewComment = "review_comment" - case _self = "self" + case pull + case triage + case push + case maintain + case admin } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public var _links: Components.Schemas.PullRequestSimple._LinksPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/permissions`. + public var permissions: Components.Schemas.NullableCollaborator.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/role_name`. + public var roleName: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `NullableCollaborator`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - email: + /// - name: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - permissions: + /// - roleName: + /// - userViewType: + public init( + login: Swift.String, + id: Swift.Int64, + email: Swift.String? = nil, + name: Swift.String? = nil, + 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, + permissions: Components.Schemas.NullableCollaborator.PermissionsPayload? = nil, + roleName: Swift.String, + userViewType: Swift.String? = nil + ) { + self.login = login + self.id = id + self.email = email + self.name = name + 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.permissions = permissions + self.roleName = roleName + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case login + case id + case email + case name + 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 permissions + case roleName = "role_name" + case userViewType = "user_view_type" + } + } + /// Repository Collaborator Permission + /// + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission`. + public struct RepositoryCollaboratorPermission: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/role_name`. + public var roleName: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/user`. + public var user: Components.Schemas.NullableCollaborator? + /// Creates a new `RepositoryCollaboratorPermission`. + /// + /// - Parameters: + /// - permission: + /// - roleName: + /// - user: + public init( + permission: Swift.String, + roleName: Swift.String, + user: Components.Schemas.NullableCollaborator? = nil + ) { + self.permission = permission + self.roleName = roleName + self.user = user + } + public enum CodingKeys: String, CodingKey { + case permission + case roleName = "role_name" + case user + } + } + /// Commit Comment + /// + /// - Remark: Generated from `#/components/schemas/commit-comment`. + public struct CommitComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/commit-comment/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/body`. + public var body: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/path`. + public var path: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment/position`. + public var position: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment/line`. + public var line: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment/commit_id`. + public var commitId: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/commit-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/commit-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/commit-comment/author_association`. public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. - public var autoMerge: Components.Schemas.AutoMerge? - /// Indicates whether or not the pull request is a draft. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. - public var draft: Swift.Bool? - /// Creates a new `PullRequestSimple`. + /// - Remark: Generated from `#/components/schemas/commit-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// Creates a new `CommitComment`. /// /// - Parameters: + /// - htmlUrl: /// - url: /// - id: /// - nodeId: - /// - htmlUrl: - /// - diffUrl: - /// - patchUrl: - /// - issueUrl: - /// - commitsUrl: - /// - reviewCommentsUrl: - /// - reviewCommentUrl: - /// - commentsUrl: - /// - statusesUrl: - /// - number: - /// - state: - /// - locked: - /// - title: - /// - user: /// - body: - /// - labels: - /// - milestone: - /// - activeLockReason: + /// - path: + /// - position: + /// - line: + /// - commitId: + /// - user: /// - createdAt: /// - updatedAt: - /// - closedAt: - /// - mergedAt: - /// - mergeCommitSha: - /// - assignee: - /// - assignees: - /// - requestedReviewers: - /// - requestedTeams: - /// - head: - /// - base: - /// - _links: /// - authorAssociation: - /// - autoMerge: - /// - draft: Indicates whether or not the pull request is a draft. + /// - reactions: public init( + htmlUrl: Swift.String, url: Swift.String, - id: Swift.Int64, + id: Swift.Int, nodeId: Swift.String, - htmlUrl: Swift.String, - diffUrl: Swift.String, - patchUrl: Swift.String, - issueUrl: Swift.String, - commitsUrl: Swift.String, - reviewCommentsUrl: Swift.String, - reviewCommentUrl: Swift.String, - commentsUrl: Swift.String, - statusesUrl: Swift.String, - number: Swift.Int, - state: Swift.String, - locked: Swift.Bool, - title: Swift.String, + body: Swift.String, + path: Swift.String? = nil, + position: Swift.Int? = nil, + line: Swift.Int? = nil, + commitId: Swift.String, user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String? = nil, - labels: Components.Schemas.PullRequestSimple.LabelsPayload, - milestone: Components.Schemas.NullableMilestone? = nil, - activeLockReason: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - mergedAt: Foundation.Date? = nil, - mergeCommitSha: Swift.String? = nil, - assignee: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil, - requestedReviewers: [Components.Schemas.SimpleUser]? = nil, - requestedTeams: [Components.Schemas.Team]? = nil, - head: Components.Schemas.PullRequestSimple.HeadPayload, - base: Components.Schemas.PullRequestSimple.BasePayload, - _links: Components.Schemas.PullRequestSimple._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, - autoMerge: Components.Schemas.AutoMerge? = nil, - draft: Swift.Bool? = nil + reactions: Components.Schemas.ReactionRollup? = nil ) { + self.htmlUrl = htmlUrl self.url = url self.id = id self.nodeId = nodeId - self.htmlUrl = htmlUrl - self.diffUrl = diffUrl - self.patchUrl = patchUrl - self.issueUrl = issueUrl - self.commitsUrl = commitsUrl - self.reviewCommentsUrl = reviewCommentsUrl - self.reviewCommentUrl = reviewCommentUrl - self.commentsUrl = commentsUrl - self.statusesUrl = statusesUrl - self.number = number - self.state = state - self.locked = locked - self.title = title - self.user = user self.body = body - self.labels = labels - self.milestone = milestone - self.activeLockReason = activeLockReason + self.path = path + self.position = position + self.line = line + self.commitId = commitId + self.user = user self.createdAt = createdAt self.updatedAt = updatedAt - self.closedAt = closedAt - self.mergedAt = mergedAt - self.mergeCommitSha = mergeCommitSha - self.assignee = assignee - self.assignees = assignees - self.requestedReviewers = requestedReviewers - self.requestedTeams = requestedTeams - self.head = head - self.base = base - self._links = _links self.authorAssociation = authorAssociation - self.autoMerge = autoMerge - self.draft = draft + self.reactions = reactions } public enum CodingKeys: String, CodingKey { + case htmlUrl = "html_url" case url case id case nodeId = "node_id" - case htmlUrl = "html_url" - case diffUrl = "diff_url" - case patchUrl = "patch_url" - case issueUrl = "issue_url" - case commitsUrl = "commits_url" - case reviewCommentsUrl = "review_comments_url" - case reviewCommentUrl = "review_comment_url" - case commentsUrl = "comments_url" - case statusesUrl = "statuses_url" - case number - case state - case locked - case title - case user case body - case labels - case milestone - case activeLockReason = "active_lock_reason" + case path + case position + case line + case commitId = "commit_id" + case user case createdAt = "created_at" case updatedAt = "updated_at" - case closedAt = "closed_at" - case mergedAt = "merged_at" - case mergeCommitSha = "merge_commit_sha" - case assignee - case assignees - case requestedReviewers = "requested_reviewers" - case requestedTeams = "requested_teams" - case head - case base - case _links case authorAssociation = "author_association" - case autoMerge = "auto_merge" - case draft + case reactions + } + } + /// Branch Short + /// + /// - Remark: Generated from `#/components/schemas/branch-short`. + public struct BranchShort: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-short/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-short/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-short/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-short/commit/url`. + public var url: Swift.String + /// Creates a new `CommitPayload`. + /// + /// - Parameters: + /// - sha: + /// - url: + public init( + sha: Swift.String, + url: Swift.String + ) { + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } + } + /// - Remark: Generated from `#/components/schemas/branch-short/commit`. + public var commit: Components.Schemas.BranchShort.CommitPayload + /// - Remark: Generated from `#/components/schemas/branch-short/protected`. + public var protected: Swift.Bool + /// Creates a new `BranchShort`. + /// + /// - Parameters: + /// - name: + /// - commit: + /// - protected: + public init( + name: Swift.String, + commit: Components.Schemas.BranchShort.CommitPayload, + protected: Swift.Bool + ) { + self.name = name + self.commit = commit + self.protected = protected + } + public enum CodingKeys: String, CodingKey { + case name + case commit + case protected } } /// - Remark: Generated from `#/components/schemas/simple-commit-status`. From 47865a295fd9e4498b5c5cf97e7bba646c49805e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 15 Sep 2025 21:50:31 +0000 Subject: [PATCH 12/46] Commit via running: make Sources/projects --- Sources/projects/Client.swift | 2358 ++++++++ Sources/projects/Types.swift | 9464 ++++++++++++++++++++++++++++++++- 2 files changed, 11816 insertions(+), 6 deletions(-) diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index 87202523ac..3b8fa88a4b 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -38,4 +38,2362 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List projects for organization + /// + /// List all projects owned by a specific organization accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + public func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2", + 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: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsListForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectsV2].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get project for organization + /// + /// Get a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public func projectsGetForOrg(_ input: Operations.ProjectsGetForOrg.Input) async throws -> Operations.ProjectsGetForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetForOrg.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.ProjectsGetForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public func projectsListFieldsForOrg(_ input: Operations.ProjectsListFieldsForOrg.Input) async throws -> Operations.ProjectsListFieldsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListFieldsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/fields", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.ProjectsListFieldsForOrg.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.ProjectsListFieldsForOrg.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.ProjectsV2Field].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 + ) + ) + } + } + ) + } + /// Get project field for organization + /// + /// Get a specific field for an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public func projectsGetFieldForOrg(_ input: Operations.ProjectsGetFieldForOrg.Input) async throws -> Operations.ProjectsGetFieldForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetFieldForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/fields/{}", + parameters: [ + input.path.org, + input.path.projectNumber, + input.path.fieldId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetFieldForOrg.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.ProjectsGetFieldForOrg.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.ProjectsV2Field.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public func projectsListItemsForOrg(_ input: Operations.ProjectsListItemsForOrg.Input) async throws -> Operations.ProjectsListItemsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListItemsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/items", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListItemsForOrg.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.ProjectsListItemsForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectsV2ItemWithContent].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add item to organization owned project + /// + /// Add an issue or pull request item to the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public func projectsAddItemForOrg(_ input: Operations.ProjectsAddItemForOrg.Input) async throws -> Operations.ProjectsAddItemForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsAddItemForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/items", + parameters: [ + input.path.org, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsAddItemForOrg.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an item for an organization owned project + /// + /// Get a specific item from an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public func projectsGetOrgItem(_ input: Operations.ProjectsGetOrgItem.Input) async throws -> Operations.ProjectsGetOrgItem.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetOrgItem.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.org, + input.path.projectNumber, + input.path.itemId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + 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.ProjectsGetOrgItem.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.ProjectsGetOrgItem.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemWithContent.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update project item for organization + /// + /// Update a specific item in an organization-owned project. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public func projectsUpdateItemForOrg(_ input: Operations.ProjectsUpdateItemForOrg.Input) async throws -> Operations.ProjectsUpdateItemForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsUpdateItemForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.org, + input.path.projectNumber, + input.path.itemId + ] + ) + 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.ProjectsUpdateItemForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemWithContent.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete project item for organization + /// + /// Delete a specific item from an organization-owned project. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsDeleteItemForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.org, + input.path.projectNumber, + input.path.itemId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 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 for user + /// + /// Get a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + public func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsGetForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListFieldsForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/fields", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.ProjectsListFieldsForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsListFieldsForUser.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.ProjectsV2Field].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 + ) + ) + } + } + ) + } + /// Get project field for user + /// + /// Get a specific field for a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetFieldForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/fields/{}", + parameters: [ + input.path.userId, + input.path.projectNumber, + input.path.fieldId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetFieldForUser.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.ProjectsGetFieldForUser.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.ProjectsV2Field.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List items for a user owned project + /// + /// List all items for a specific user-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListItemsForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + 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.ProjectsListItemsForUser.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.ProjectsListItemsForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectsV2ItemWithContent].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add item to user owned project + /// + /// Add an issue or pull request item to the specified user owned project. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsAddItemForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items", + parameters: [ + input.path.userId, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsAddItemForUser.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetUserItem.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.userId, + input.path.projectNumber, + input.path.itemId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + 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.ProjectsGetUserItem.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.ProjectsGetUserItem.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemWithContent.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update project item for user + /// + /// Update a specific item in a user-owned project. + /// + /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsUpdateItemForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.userId, + input.path.projectNumber, + input.path.itemId + ] + ) + 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.ProjectsUpdateItemForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2ItemWithContent.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete project item for user + /// + /// Delete a specific item from a user-owned project. + /// + /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsDeleteItemForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.userId, + input.path.projectNumber, + input.path.itemId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 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 projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsListForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectsV2].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index c3d1209ecf..548e41ea0a 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -10,10 +10,431 @@ import struct Foundation.Data import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable {} +public protocol APIProtocol: Sendable { + /// List projects for organization + /// + /// List all projects owned by a specific organization accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output + /// Get project for organization + /// + /// Get a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + func projectsGetForOrg(_ input: Operations.ProjectsGetForOrg.Input) async throws -> Operations.ProjectsGetForOrg.Output + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + func projectsListFieldsForOrg(_ input: Operations.ProjectsListFieldsForOrg.Input) async throws -> Operations.ProjectsListFieldsForOrg.Output + /// Get project field for organization + /// + /// Get a specific field for an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + func projectsGetFieldForOrg(_ input: Operations.ProjectsGetFieldForOrg.Input) async throws -> Operations.ProjectsGetFieldForOrg.Output + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + func projectsListItemsForOrg(_ input: Operations.ProjectsListItemsForOrg.Input) async throws -> Operations.ProjectsListItemsForOrg.Output + /// Add item to organization owned project + /// + /// Add an issue or pull request item to the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + func projectsAddItemForOrg(_ input: Operations.ProjectsAddItemForOrg.Input) async throws -> Operations.ProjectsAddItemForOrg.Output + /// Get an item for an organization owned project + /// + /// Get a specific item from an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + func projectsGetOrgItem(_ input: Operations.ProjectsGetOrgItem.Input) async throws -> Operations.ProjectsGetOrgItem.Output + /// Update project item for organization + /// + /// Update a specific item in an organization-owned project. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + func projectsUpdateItemForOrg(_ input: Operations.ProjectsUpdateItemForOrg.Input) async throws -> Operations.ProjectsUpdateItemForOrg.Output + /// Delete project item for organization + /// + /// Delete a specific item from an organization-owned project. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output + /// Get project for user + /// + /// Get a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output + /// List project fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output + /// Get project field for user + /// + /// Get a specific field for a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output + /// List items for a user owned project + /// + /// List all items for a specific user-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output + /// Add item to user owned project + /// + /// Add an issue or pull request item to the specified user owned project. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output + /// Update project item for user + /// + /// Update a specific item in a user-owned project. + /// + /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output + /// Delete project item for user + /// + /// Delete a specific item from a user-owned project. + /// + /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List projects for organization + /// + /// List all projects owned by a specific organization accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + public func projectsListForOrg( + path: Operations.ProjectsListForOrg.Input.Path, + query: Operations.ProjectsListForOrg.Input.Query = .init(), + headers: Operations.ProjectsListForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListForOrg.Output { + try await projectsListForOrg(Operations.ProjectsListForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get project for organization + /// + /// Get a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public func projectsGetForOrg( + path: Operations.ProjectsGetForOrg.Input.Path, + headers: Operations.ProjectsGetForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetForOrg.Output { + try await projectsGetForOrg(Operations.ProjectsGetForOrg.Input( + path: path, + headers: headers + )) + } + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public func projectsListFieldsForOrg( + path: Operations.ProjectsListFieldsForOrg.Input.Path, + query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListFieldsForOrg.Output { + try await projectsListFieldsForOrg(Operations.ProjectsListFieldsForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get project field for organization + /// + /// Get a specific field for an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public func projectsGetFieldForOrg( + path: Operations.ProjectsGetFieldForOrg.Input.Path, + headers: Operations.ProjectsGetFieldForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetFieldForOrg.Output { + try await projectsGetFieldForOrg(Operations.ProjectsGetFieldForOrg.Input( + path: path, + headers: headers + )) + } + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public func projectsListItemsForOrg( + path: Operations.ProjectsListItemsForOrg.Input.Path, + query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListItemsForOrg.Output { + try await projectsListItemsForOrg(Operations.ProjectsListItemsForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add item to organization owned project + /// + /// Add an issue or pull request item to the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public func projectsAddItemForOrg( + path: Operations.ProjectsAddItemForOrg.Input.Path, + headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddItemForOrg.Input.Body + ) async throws -> Operations.ProjectsAddItemForOrg.Output { + try await projectsAddItemForOrg(Operations.ProjectsAddItemForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an item for an organization owned project + /// + /// Get a specific item from an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public func projectsGetOrgItem( + path: Operations.ProjectsGetOrgItem.Input.Path, + query: Operations.ProjectsGetOrgItem.Input.Query = .init(), + headers: Operations.ProjectsGetOrgItem.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetOrgItem.Output { + try await projectsGetOrgItem(Operations.ProjectsGetOrgItem.Input( + path: path, + query: query, + headers: headers + )) + } + /// Update project item for organization + /// + /// Update a specific item in an organization-owned project. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public func projectsUpdateItemForOrg( + path: Operations.ProjectsUpdateItemForOrg.Input.Path, + headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForOrg.Input.Body + ) async throws -> Operations.ProjectsUpdateItemForOrg.Output { + try await projectsUpdateItemForOrg(Operations.ProjectsUpdateItemForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete project item for organization + /// + /// Delete a specific item from an organization-owned project. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public func projectsDeleteItemForOrg( + path: Operations.ProjectsDeleteItemForOrg.Input.Path, + headers: Operations.ProjectsDeleteItemForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsDeleteItemForOrg.Output { + try await projectsDeleteItemForOrg(Operations.ProjectsDeleteItemForOrg.Input( + path: path, + headers: headers + )) + } + /// Get project for user + /// + /// Get a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + public func projectsGetForUser( + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetForUser.Output { + try await projectsGetForUser(Operations.ProjectsGetForUser.Input( + path: path, + headers: headers + )) + } + /// List project fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public func projectsListFieldsForUser( + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListFieldsForUser.Output { + try await projectsListFieldsForUser(Operations.ProjectsListFieldsForUser.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get project field for user + /// + /// Get a specific field for a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public func projectsGetFieldForUser( + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetFieldForUser.Output { + try await projectsGetFieldForUser(Operations.ProjectsGetFieldForUser.Input( + path: path, + headers: headers + )) + } + /// List items for a user owned project + /// + /// List all items for a specific user-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public func projectsListItemsForUser( + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListItemsForUser.Output { + try await projectsListItemsForUser(Operations.ProjectsListItemsForUser.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add item to user owned project + /// + /// Add an issue or pull request item to the specified user owned project. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public func projectsAddItemForUser( + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.Input.Body + ) async throws -> Operations.ProjectsAddItemForUser.Output { + try await projectsAddItemForUser(Operations.ProjectsAddItemForUser.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public func projectsGetUserItem( + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetUserItem.Output { + try await projectsGetUserItem(Operations.ProjectsGetUserItem.Input( + path: path, + query: query, + headers: headers + )) + } + /// Update project item for user + /// + /// Update a specific item in a user-owned project. + /// + /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public func projectsUpdateItemForUser( + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.Input.Body + ) async throws -> Operations.ProjectsUpdateItemForUser.Output { + try await projectsUpdateItemForUser(Operations.ProjectsUpdateItemForUser.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete project item for user + /// + /// Delete a specific item from a user-owned project. + /// + /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public func projectsDeleteItemForUser( + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsDeleteItemForUser.Output { + try await projectsDeleteItemForUser(Operations.ProjectsDeleteItemForUser.Input( + path: path, + headers: headers + )) + } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListForUser.Output { + try await projectsListForUser(Operations.ProjectsListForUser.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -38,16 +459,9047 @@ public enum Servers { /// Types generated from the components section of the OpenAPI document. public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. - public enum Schemas {} + 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 + } + } + /// An enterprise on GitHub. + /// + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct Enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var htmlUrl: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var websiteUrl: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. + public var nodeId: Swift.String + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. + public var avatarUrl: Swift.String + /// Creates a new `Enterprise`. + /// + /// - Parameters: + /// - description: A short description of the enterprise. + /// - htmlUrl: + /// - websiteUrl: The enterprise's website URL. + /// - id: Unique identifier of the enterprise + /// - nodeId: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - createdAt: + /// - updatedAt: + /// - avatarUrl: + public init( + description: Swift.String? = nil, + htmlUrl: Swift.String, + websiteUrl: Swift.String? = nil, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + avatarUrl: Swift.String + ) { + self.description = description + self.htmlUrl = htmlUrl + self.websiteUrl = websiteUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.createdAt = createdAt + self.updatedAt = updatedAt + self.avatarUrl = avatarUrl + } + public enum CodingKeys: String, CodingKey { + case description + case htmlUrl = "html_url" + case websiteUrl = "website_url" + case id + case nodeId = "node_id" + case name + case slug + case createdAt = "created_at" + case updatedAt = "updated_at" + case avatarUrl = "avatar_url" + } + } + /// 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" + } + } + /// License Simple + /// + /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. + public struct NullableLicenseSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. + public var spdxId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `NullableLicenseSimple`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - spdxId: + /// - nodeId: + /// - htmlUrl: + public init( + key: Swift.String, + name: Swift.String, + url: Swift.String? = nil, + spdxId: Swift.String? = nil, + nodeId: Swift.String, + htmlUrl: Swift.String? = nil + ) { + self.key = key + self.name = name + self.url = url + self.spdxId = spdxId + self.nodeId = nodeId + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case key + case name + case url + case spdxId = "spdx_id" + case nodeId = "node_id" + case htmlUrl = "html_url" + } + } + /// A repository on GitHub. + /// + /// - Remark: Generated from `#/components/schemas/repository`. + public struct Repository: Codable, Hashable, Sendable { + /// Unique identifier of the repository + /// + /// - Remark: Generated from `#/components/schemas/repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/repository/node_id`. + public var nodeId: Swift.String + /// The name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/repository/forks`. + public var forks: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/permissions/admin`. + public var admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + public init( + admin: Swift.Bool, + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil + ) { + self.admin = admin + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + } + public enum CodingKeys: String, CodingKey { + case admin + case pull + case triage + case push + case maintain + } + } + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public var permissions: Components.Schemas.Repository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private or public. + /// + /// - Remark: Generated from `#/components/schemas/repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_url`. + public var gitUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/ssh_url`. + public var sshUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/clone_url`. + public var cloneUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/svn_url`. + public var svnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/forks_count`. + public var forksCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/stargazers_count`. + public var stargazersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers_count`. + public var watchersCount: Swift.Int + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// + /// - Remark: Generated from `#/components/schemas/repository/size`. + public var size: Swift.Int + /// The default branch of the repository. + /// + /// - Remark: Generated from `#/components/schemas/repository/default_branch`. + public var defaultBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/open_issues_count`. + public var openIssuesCount: Swift.Int + /// Whether this repository acts as a template that can be used to generate new repositories. + /// + /// - Remark: Generated from `#/components/schemas/repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/topics`. + public var topics: [Swift.String]? + /// Whether issues are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_issues`. + public var hasIssues: Swift.Bool + /// Whether projects are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_projects`. + public var hasProjects: Swift.Bool + /// Whether the wiki is enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_wiki`. + public var hasWiki: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/has_pages`. + public var hasPages: Swift.Bool + /// Whether downloads are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_downloads`. + @available(*, deprecated) + public var hasDownloads: Swift.Bool + /// Whether discussions are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// Whether the repository is archived. + /// + /// - Remark: Generated from `#/components/schemas/repository/archived`. + public var archived: Swift.Bool + /// Returns whether or not this repository disabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/disabled`. + public var disabled: Swift.Bool + /// The repository visibility: public, private, or internal. + /// + /// - Remark: Generated from `#/components/schemas/repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/updated_at`. + public var updatedAt: Foundation.Date? + /// Whether to allow rebase merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_rebase_merge`. + public var allowRebaseMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// Whether to allow squash merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_squash_merge`. + public var allowSquashMerge: Swift.Bool? + /// Whether to allow Auto-merge to be used on pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_auto_merge`. + public var allowAutoMerge: Swift.Bool? + /// Whether to delete head branches when pull requests are merged + /// + /// - Remark: Generated from `#/components/schemas/repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. + public var allowUpdateBranch: Swift.Bool? + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// + /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. + @available(*, deprecated) + public var useSquashPrTitleAsDefault: Swift.Bool? + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case commitOrPrTitle = "COMMIT_OR_PR_TITLE" + } + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + public var squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case commitMessages = "COMMIT_MESSAGES" + case blank = "BLANK" + } + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + public var squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case mergeMessage = "MERGE_MESSAGE" + } + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + public var mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case prTitle = "PR_TITLE" + case blank = "BLANK" + } + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + public var mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? + /// Whether to allow merge commits for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_merge_commit`. + public var allowMergeCommit: Swift.Bool? + /// Whether to allow forking this repo + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_forking`. + public var allowForking: Swift.Bool? + /// Whether to require contributors to sign off on web-based commits + /// + /// - Remark: Generated from `#/components/schemas/repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers`. + public var watchers: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/master_branch`. + public var masterBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/starred_at`. + public var starredAt: Swift.String? + /// Whether anonymous git access is enabled for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. + public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? + /// Creates a new `Repository`. + /// + /// - Parameters: + /// - id: Unique identifier of the repository + /// - nodeId: + /// - name: The name of the repository. + /// - fullName: + /// - license: + /// - forks: + /// - permissions: + /// - owner: + /// - _private: Whether the repository is private or public. + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: The default branch of the repository. + /// - openIssuesCount: + /// - isTemplate: Whether this repository acts as a template that can be used to generate new repositories. + /// - topics: + /// - hasIssues: Whether issues are enabled. + /// - hasProjects: Whether projects are enabled. + /// - hasWiki: Whether the wiki is enabled. + /// - hasPages: + /// - hasDownloads: Whether downloads are enabled. + /// - hasDiscussions: Whether discussions are enabled. + /// - archived: Whether the repository is archived. + /// - disabled: Returns whether or not this repository disabled. + /// - visibility: The repository visibility: public, private, or internal. + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - allowRebaseMerge: Whether to allow rebase merges for pull requests. + /// - tempCloneToken: + /// - allowSquashMerge: Whether to allow squash merges for pull requests. + /// - allowAutoMerge: Whether to allow Auto-merge to be used on pull requests. + /// - deleteBranchOnMerge: Whether to delete head branches when pull requests are merged + /// - allowUpdateBranch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// - useSquashPrTitleAsDefault: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// - squashMergeCommitTitle: The default value for a squash merge commit title: + /// - squashMergeCommitMessage: The default value for a squash merge commit message: + /// - mergeCommitTitle: The default value for a merge commit title. + /// - mergeCommitMessage: The default value for a merge commit message. + /// - allowMergeCommit: Whether to allow merge commits for pull requests. + /// - allowForking: Whether to allow forking this repo + /// - webCommitSignoffRequired: Whether to require contributors to sign off on web-based commits + /// - openIssues: + /// - watchers: + /// - masterBranch: + /// - starredAt: + /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository + public init( + id: Swift.Int64, + nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + license: Components.Schemas.NullableLicenseSimple? = nil, + forks: Swift.Int, + permissions: Components.Schemas.Repository.PermissionsPayload? = nil, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int, + stargazersCount: Swift.Int, + watchersCount: Swift.Int, + size: Swift.Int, + defaultBranch: Swift.String, + openIssuesCount: Swift.Int, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool, + hasProjects: Swift.Bool, + hasWiki: Swift.Bool, + hasPages: Swift.Bool, + hasDownloads: Swift.Bool, + hasDiscussions: Swift.Bool? = nil, + archived: Swift.Bool, + disabled: Swift.Bool, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + allowRebaseMerge: Swift.Bool? = nil, + tempCloneToken: Swift.String? = nil, + allowSquashMerge: Swift.Bool? = nil, + allowAutoMerge: Swift.Bool? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + allowUpdateBranch: Swift.Bool? = nil, + useSquashPrTitleAsDefault: Swift.Bool? = nil, + squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? = nil, + squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? = nil, + mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? = nil, + mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? = nil, + allowMergeCommit: Swift.Bool? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + openIssues: Swift.Int, + watchers: Swift.Int, + masterBranch: Swift.String? = nil, + starredAt: Swift.String? = nil, + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.license = license + self.forks = forks + self.permissions = permissions + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.allowRebaseMerge = allowRebaseMerge + self.tempCloneToken = tempCloneToken + self.allowSquashMerge = allowSquashMerge + self.allowAutoMerge = allowAutoMerge + self.deleteBranchOnMerge = deleteBranchOnMerge + self.allowUpdateBranch = allowUpdateBranch + self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault + self.squashMergeCommitTitle = squashMergeCommitTitle + self.squashMergeCommitMessage = squashMergeCommitMessage + self.mergeCommitTitle = mergeCommitTitle + self.mergeCommitMessage = mergeCommitMessage + self.allowMergeCommit = allowMergeCommit + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.openIssues = openIssues + self.watchers = watchers + self.masterBranch = masterBranch + self.starredAt = starredAt + self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case license + case forks + case permissions + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case allowRebaseMerge = "allow_rebase_merge" + case tempCloneToken = "temp_clone_token" + case allowSquashMerge = "allow_squash_merge" + case allowAutoMerge = "allow_auto_merge" + case deleteBranchOnMerge = "delete_branch_on_merge" + case allowUpdateBranch = "allow_update_branch" + case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" + case squashMergeCommitTitle = "squash_merge_commit_title" + case squashMergeCommitMessage = "squash_merge_commit_message" + case mergeCommitTitle = "merge_commit_title" + case mergeCommitMessage = "merge_commit_message" + case allowMergeCommit = "allow_merge_commit" + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case openIssues = "open_issues" + case watchers + case masterBranch = "master_branch" + case starredAt = "starred_at" + case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" + } + } + /// A collection of related issues and pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct NullableMilestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var nodeId: Swift.String + /// The number of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.NullableMilestone.StatePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closedIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var dueOn: Foundation.Date? + /// Creates a new `NullableMilestone`. + /// + /// - Parameters: + /// - url: + /// - htmlUrl: + /// - labelsUrl: + /// - id: + /// - nodeId: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - openIssues: + /// - closedIssues: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - dueOn: + public init( + url: Swift.String, + htmlUrl: Swift.String, + labelsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + number: Swift.Int, + state: Components.Schemas.NullableMilestone.StatePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.NullableSimpleUser? = nil, + openIssues: Swift.Int, + closedIssues: Swift.Int, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + dueOn: Foundation.Date? = nil + ) { + self.url = url + self.htmlUrl = htmlUrl + self.labelsUrl = labelsUrl + self.id = id + self.nodeId = nodeId + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.openIssues = openIssues + self.closedIssues = closedIssues + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.dueOn = dueOn + } + public enum CodingKeys: String, CodingKey { + case url + case htmlUrl = "html_url" + case labelsUrl = "labels_url" + case id + case nodeId = "node_id" + case number + case state + case title + case description + case creator + case openIssues = "open_issues" + case closedIssues = "closed_issues" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case dueOn = "due_on" + } + } + /// The type of issue. + /// + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct IssueType: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var nodeId: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.IssueType.ColorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var createdAt: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updatedAt: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var isEnabled: Swift.Bool? + /// Creates a new `IssueType`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - nodeId: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - createdAt: The time the issue type created. + /// - updatedAt: The time the issue type last updated. + /// - isEnabled: The enabled state of the issue type. + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.IssueType.ColorPayload? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + isEnabled: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.description = description + self.color = color + self.createdAt = createdAt + self.updatedAt = updatedAt + self.isEnabled = isEnabled + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case description + case color + case createdAt = "created_at" + case updatedAt = "updated_at" + case isEnabled = "is_enabled" + } + } + /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration`. + public struct NullableIntegration: Codable, Hashable, Sendable { + /// Unique identifier of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. + public var id: Swift.Int + /// The slug name of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. + public var slug: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var clientId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + @frozen public enum OwnerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case Enterprise(Components.Schemas.Enterprise) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .Enterprise(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 .SimpleUser(value): + try value.encode(to: encoder) + case let .Enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.NullableIntegration.OwnerPayload + /// The name of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. + public var externalUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. + public var updatedAt: Foundation.Date + /// The set of permissions for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. + public var issues: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. + public var checks: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. + public var metadata: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. + public var contents: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. + public var deployments: Swift.String? + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - issues: + /// - checks: + /// - metadata: + /// - contents: + /// - deployments: + /// - additionalProperties: A container of undocumented properties. + public init( + issues: Swift.String? = nil, + checks: Swift.String? = nil, + metadata: Swift.String? = nil, + contents: Swift.String? = nil, + deployments: Swift.String? = nil, + additionalProperties: [String: Swift.String] = .init() + ) { + self.issues = issues + self.checks = checks + self.metadata = metadata + self.contents = contents + self.deployments = deployments + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case issues + case checks + case metadata + case contents + case deployments + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.issues = try container.decodeIfPresent( + Swift.String.self, + forKey: .issues + ) + self.checks = try container.decodeIfPresent( + Swift.String.self, + forKey: .checks + ) + self.metadata = try container.decodeIfPresent( + Swift.String.self, + forKey: .metadata + ) + self.contents = try container.decodeIfPresent( + Swift.String.self, + forKey: .contents + ) + self.deployments = try container.decodeIfPresent( + Swift.String.self, + forKey: .deployments + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "issues", + "checks", + "metadata", + "contents", + "deployments" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.issues, + forKey: .issues + ) + try container.encodeIfPresent( + self.checks, + forKey: .checks + ) + try container.encodeIfPresent( + self.metadata, + forKey: .metadata + ) + try container.encodeIfPresent( + self.contents, + forKey: .contents + ) + try container.encodeIfPresent( + self.deployments, + forKey: .deployments + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The set of permissions for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. + public var events: [Swift.String] + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. + public var installationsCount: Swift.Int? + /// Creates a new `NullableIntegration`. + /// + /// - Parameters: + /// - id: Unique identifier of the GitHub app + /// - slug: The slug name of the GitHub app + /// - nodeId: + /// - clientId: + /// - owner: + /// - name: The name of the GitHub app + /// - description: + /// - externalUrl: + /// - htmlUrl: + /// - createdAt: + /// - updatedAt: + /// - permissions: The set of permissions for the GitHub app + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. + public init( + id: Swift.Int, + slug: Swift.String? = nil, + nodeId: Swift.String, + clientId: Swift.String? = nil, + owner: Components.Schemas.NullableIntegration.OwnerPayload, + name: Swift.String, + description: Swift.String? = nil, + externalUrl: Swift.String, + htmlUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + permissions: Components.Schemas.NullableIntegration.PermissionsPayload, + events: [Swift.String], + installationsCount: Swift.Int? = nil + ) { + self.id = id + self.slug = slug + self.nodeId = nodeId + self.clientId = clientId + self.owner = owner + self.name = name + self.description = description + self.externalUrl = externalUrl + self.htmlUrl = htmlUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + self.permissions = permissions + self.events = events + self.installationsCount = installationsCount + } + public enum CodingKeys: String, CodingKey { + case id + case slug + case nodeId = "node_id" + case clientId = "client_id" + case owner + case name + case description + case externalUrl = "external_url" + case htmlUrl = "html_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case events + case installationsCount = "installations_count" + } + } + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum AuthorAssociation: String, Codable, Hashable, Sendable, CaseIterable { + case collaborator = "COLLABORATOR" + case contributor = "CONTRIBUTOR" + case firstTimer = "FIRST_TIMER" + case firstTimeContributor = "FIRST_TIME_CONTRIBUTOR" + case mannequin = "MANNEQUIN" + case member = "MEMBER" + case none = "NONE" + case owner = "OWNER" + } + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct ReactionRollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `ReactionRollup`. + /// + /// - Parameters: + /// - url: + /// - totalCount: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: + public init( + url: Swift.String, + totalCount: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int + ) { + self.url = url + self.totalCount = totalCount + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket + } + public enum CodingKeys: String, CodingKey { + case url + case totalCount = "total_count" + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket + } + } + /// - Remark: Generated from `#/components/schemas/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/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value3 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2, + self.value3 + ]) + } + } + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public var value: Components.Schemas.IssueFieldValue.ValuePayload? + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public struct SingleSelectOptionPayload: Codable, Hashable, Sendable { + /// Unique identifier for the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/id`. + public var id: Swift.Int64 + /// The name of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/name`. + public var name: Swift.String + /// The color of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/color`. + public var color: Swift.String + /// Creates a new `SingleSelectOptionPayload`. + /// + /// - Parameters: + /// - id: Unique identifier for the option. + /// - name: The name of the option + /// - color: The color of the option + public init( + id: Swift.Int64, + name: Swift.String, + color: Swift.String + ) { + self.id = id + self.name = name + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case color + } + } + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public var singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? + /// Creates a new `IssueFieldValue`. + /// + /// - Parameters: + /// - issueFieldId: Unique identifier for the issue field. + /// - nodeId: + /// - dataType: The data type of the issue field + /// - value: The value of the issue field + /// - singleSelectOption: Details about the selected option (only present for single_select fields) + public init( + issueFieldId: Swift.Int64, + nodeId: Swift.String, + dataType: Components.Schemas.IssueFieldValue.DataTypePayload, + value: Components.Schemas.IssueFieldValue.ValuePayload? = nil, + singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? = nil + ) { + self.issueFieldId = issueFieldId + self.nodeId = nodeId + self.dataType = dataType + self.value = value + self.singleSelectOption = singleSelectOption + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + case nodeId = "node_id" + case dataType = "data_type" + case value + case singleSelectOption = "single_select_option" + } + } + /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + /// + /// - Remark: Generated from `#/components/schemas/issue`. + public struct Issue: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue/node_id`. + public var nodeId: Swift.String + /// URL for the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/repository_url`. + public var repositoryUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/html_url`. + public var htmlUrl: Swift.String + /// Number uniquely identifying the issue within its repository + /// + /// - Remark: Generated from `#/components/schemas/issue/number`. + public var number: Swift.Int + /// State of the issue; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/components/schemas/issue/state`. + public var state: Swift.String + /// The reason for the current state + /// + /// - Remark: Generated from `#/components/schemas/issue/state_reason`. + @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case completed = "completed" + case reopened = "reopened" + case notPlanned = "not_planned" + case duplicate = "duplicate" + } + /// The reason for the current state + /// + /// - Remark: Generated from `#/components/schemas/issue/state_reason`. + public var stateReason: Components.Schemas.Issue.StateReasonPayload? + /// Title of the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/title`. + public var title: Swift.String + /// Contents of the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload`. + @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/id`. + public var id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/color`. + public var color: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/default`. + public var _default: Swift.Bool? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64? = nil, + nodeId: Swift.String? = nil, + url: Swift.String? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + color: Swift.String? = nil, + _default: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. + case case2(Components.Schemas.Issue.LabelsPayloadPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// + /// - Remark: Generated from `#/components/schemas/issue/labels`. + public typealias LabelsPayload = [Components.Schemas.Issue.LabelsPayloadPayload] + /// Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// + /// - Remark: Generated from `#/components/schemas/issue/labels`. + public var labels: Components.Schemas.Issue.LabelsPayload + /// - Remark: Generated from `#/components/schemas/issue/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/issue/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/issue/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/issue/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/comments`. + public var comments: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/pull_request/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/diff_url`. + public var diffUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/patch_url`. + public var patchUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/url`. + public var url: Swift.String? + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - mergedAt: + /// - diffUrl: + /// - htmlUrl: + /// - patchUrl: + /// - url: + public init( + mergedAt: Foundation.Date? = nil, + diffUrl: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + patchUrl: Swift.String? = nil, + url: Swift.String? = nil + ) { + self.mergedAt = mergedAt + self.diffUrl = diffUrl + self.htmlUrl = htmlUrl + self.patchUrl = patchUrl + self.url = url + } + public enum CodingKeys: String, CodingKey { + case mergedAt = "merged_at" + case diffUrl = "diff_url" + case htmlUrl = "html_url" + case patchUrl = "patch_url" + case url + } + } + /// - Remark: Generated from `#/components/schemas/issue/pull_request`. + public var pullRequest: Components.Schemas.Issue.PullRequestPayload? + /// - Remark: Generated from `#/components/schemas/issue/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/issue/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue/draft`. + public var draft: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/issue/closed_by`. + public var closedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/timeline_url`. + public var timelineUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/type`. + public var _type: Components.Schemas.IssueType? + /// - Remark: Generated from `#/components/schemas/issue/repository`. + public var repository: Components.Schemas.Repository? + /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/issue/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/issue/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. + public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? + /// Creates a new `Issue`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: URL for the issue + /// - repositoryUrl: + /// - labelsUrl: + /// - commentsUrl: + /// - eventsUrl: + /// - htmlUrl: + /// - number: Number uniquely identifying the issue within its repository + /// - state: State of the issue; either 'open' or 'closed' + /// - stateReason: The reason for the current state + /// - title: Title of the issue + /// - body: Contents of the issue + /// - user: + /// - labels: Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// - assignee: + /// - assignees: + /// - milestone: + /// - locked: + /// - activeLockReason: + /// - comments: + /// - pullRequest: + /// - closedAt: + /// - createdAt: + /// - updatedAt: + /// - draft: + /// - closedBy: + /// - bodyHtml: + /// - bodyText: + /// - timelineUrl: + /// - _type: + /// - repository: + /// - performedViaGithubApp: + /// - authorAssociation: + /// - reactions: + /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - issueDependenciesSummary: + /// - issueFieldValues: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + repositoryUrl: Swift.String, + labelsUrl: Swift.String, + commentsUrl: Swift.String, + eventsUrl: Swift.String, + htmlUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + stateReason: Components.Schemas.Issue.StateReasonPayload? = nil, + title: Swift.String, + body: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + labels: Components.Schemas.Issue.LabelsPayload, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + milestone: Components.Schemas.NullableMilestone? = nil, + locked: Swift.Bool, + activeLockReason: Swift.String? = nil, + comments: Swift.Int, + pullRequest: Components.Schemas.Issue.PullRequestPayload? = nil, + closedAt: Foundation.Date? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + draft: Swift.Bool? = nil, + closedBy: Components.Schemas.NullableSimpleUser? = nil, + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil, + timelineUrl: Swift.String? = nil, + _type: Components.Schemas.IssueType? = nil, + repository: Components.Schemas.Repository? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.repositoryUrl = repositoryUrl + self.labelsUrl = labelsUrl + self.commentsUrl = commentsUrl + self.eventsUrl = eventsUrl + self.htmlUrl = htmlUrl + self.number = number + self.state = state + self.stateReason = stateReason + self.title = title + self.body = body + self.user = user + self.labels = labels + self.assignee = assignee + self.assignees = assignees + self.milestone = milestone + self.locked = locked + self.activeLockReason = activeLockReason + self.comments = comments + self.pullRequest = pullRequest + self.closedAt = closedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.draft = draft + self.closedBy = closedBy + self.bodyHtml = bodyHtml + self.bodyText = bodyText + self.timelineUrl = timelineUrl + self._type = _type + self.repository = repository + self.performedViaGithubApp = performedViaGithubApp + self.authorAssociation = authorAssociation + self.reactions = reactions + self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case repositoryUrl = "repository_url" + case labelsUrl = "labels_url" + case commentsUrl = "comments_url" + case eventsUrl = "events_url" + case htmlUrl = "html_url" + case number + case state + case stateReason = "state_reason" + case title + case body + case user + case labels + case assignee + case assignees + case milestone + case locked + case activeLockReason = "active_lock_reason" + case comments + case pullRequest = "pull_request" + case closedAt = "closed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case draft + case closedBy = "closed_by" + case bodyHtml = "body_html" + case bodyText = "body_text" + case timelineUrl = "timeline_url" + case _type = "type" + case repository + case performedViaGithubApp = "performed_via_github_app" + case authorAssociation = "author_association" + case reactions + case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var nodeId: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var membersUrl: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldapDn: Swift.String? + /// Creates a new `NullableTeamSimple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - nodeId: + /// - url: URL for the team + /// - membersUrl: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notificationSetting: The notification setting the team has set + /// - htmlUrl: + /// - repositoriesUrl: + /// - slug: + /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + membersUrl: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + htmlUrl: Swift.String, + repositoriesUrl: Swift.String, + slug: Swift.String, + ldapDn: Swift.String? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.membersUrl = membersUrl + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notificationSetting = notificationSetting + self.htmlUrl = htmlUrl + self.repositoriesUrl = repositoriesUrl + self.slug = slug + self.ldapDn = ldapDn + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case membersUrl = "members_url" + case name + case description + case permission + case privacy + case notificationSetting = "notification_setting" + case htmlUrl = "html_url" + case repositoriesUrl = "repositories_url" + case slug + case ldapDn = "ldap_dn" + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct Team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.Team.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.NullableTeamSimple? + /// Creates a new `Team`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notificationSetting: + /// - permission: + /// - permissions: + /// - url: + /// - htmlUrl: + /// - membersUrl: + /// - repositoriesUrl: + /// - parent: + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.Team.PermissionsPayload? = nil, + url: Swift.String, + htmlUrl: Swift.String, + membersUrl: Swift.String, + repositoriesUrl: Swift.String, + parent: Components.Schemas.NullableTeamSimple? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.permissions = permissions + self.url = url + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.repositoriesUrl = repositoriesUrl + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case slug + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case permissions + case url + case htmlUrl = "html_url" + case membersUrl = "members_url" + case repositoriesUrl = "repositories_url" + case parent + } + } + /// An status update belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update`. + public struct NullableProjectsV2StatusUpdate: Codable, Hashable, Sendable { + /// The unique identifier of the status update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/id`. + public var id: Swift.Double + /// The node ID of the status update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/node_id`. + public var nodeId: Swift.String + /// The node ID of the project that this status update belongs to. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/project_node_id`. + public var projectNodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the status update was created. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/created_at`. + public var createdAt: Foundation.Date + /// The time when the status update was last updated. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/updated_at`. + public var updatedAt: Foundation.Date + /// The current status. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case inactive = "INACTIVE" + case onTrack = "ON_TRACK" + case atRisk = "AT_RISK" + case offTrack = "OFF_TRACK" + case complete = "COMPLETE" + } + /// The current status. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/status`. + public var status: Components.Schemas.NullableProjectsV2StatusUpdate.StatusPayload? + /// The start date of the period covered by the update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/start_date`. + public var startDate: Swift.String? + /// The target date associated with the update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/target_date`. + public var targetDate: Swift.String? + /// Body of the status update + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/body`. + public var body: Swift.String? + /// Creates a new `NullableProjectsV2StatusUpdate`. + /// + /// - Parameters: + /// - id: The unique identifier of the status update. + /// - nodeId: The node ID of the status update. + /// - projectNodeId: The node ID of the project that this status update belongs to. + /// - creator: + /// - createdAt: The time when the status update was created. + /// - updatedAt: The time when the status update was last updated. + /// - status: The current status. + /// - startDate: The start date of the period covered by the update. + /// - targetDate: The target date associated with the update. + /// - body: Body of the status update + public init( + id: Swift.Double, + nodeId: Swift.String, + projectNodeId: Swift.String? = nil, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + status: Components.Schemas.NullableProjectsV2StatusUpdate.StatusPayload? = nil, + startDate: Swift.String? = nil, + targetDate: Swift.String? = nil, + body: Swift.String? = nil + ) { + self.id = id + self.nodeId = nodeId + self.projectNodeId = projectNodeId + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.status = status + self.startDate = startDate + self.targetDate = targetDate + self.body = body + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectNodeId = "project_node_id" + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case status + case startDate = "start_date" + case targetDate = "target_date" + case body + } + } + /// A projects v2 project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2`. + public struct ProjectsV2: Codable, Hashable, Sendable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/id`. + public var id: Swift.Double + /// The node ID of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2/owner`. + public var owner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/projects-v2/creator`. + public var creator: Components.Schemas.SimpleUser + /// The project title. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/title`. + public var title: Swift.String + /// A short description of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/description`. + public var description: Swift.String? + /// Whether the project is visible to anyone with access to the owner. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/public`. + public var _public: Swift.Bool + /// The time when the project was closed. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/closed_at`. + public var closedAt: Foundation.Date? + /// The time when the project was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/created_at`. + public var createdAt: Foundation.Date + /// The time when the project was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/updated_at`. + public var updatedAt: Foundation.Date + /// The project number. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/number`. + public var number: Swift.Int + /// A concise summary of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/short_description`. + public var shortDescription: Swift.String? + /// The time when the project was deleted. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/deleted_at`. + public var deletedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/projects-v2/deleted_by`. + public var deletedBy: Components.Schemas.NullableSimpleUser? + /// The current state of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The current state of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/state`. + public var state: Components.Schemas.ProjectsV2.StatePayload? + /// - Remark: Generated from `#/components/schemas/projects-v2/latest_status_update`. + public var latestStatusUpdate: Components.Schemas.NullableProjectsV2StatusUpdate? + /// Whether this project is a template + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/is_template`. + public var isTemplate: Swift.Bool? + /// Creates a new `ProjectsV2`. + /// + /// - Parameters: + /// - id: The unique identifier of the project. + /// - nodeId: The node ID of the project. + /// - owner: + /// - creator: + /// - title: The project title. + /// - description: A short description of the project. + /// - _public: Whether the project is visible to anyone with access to the owner. + /// - closedAt: The time when the project was closed. + /// - createdAt: The time when the project was created. + /// - updatedAt: The time when the project was last updated. + /// - number: The project number. + /// - shortDescription: A concise summary of the project. + /// - deletedAt: The time when the project was deleted. + /// - deletedBy: + /// - state: The current state of the project. + /// - latestStatusUpdate: + /// - isTemplate: Whether this project is a template + public init( + id: Swift.Double, + nodeId: Swift.String, + owner: Components.Schemas.SimpleUser, + creator: Components.Schemas.SimpleUser, + title: Swift.String, + description: Swift.String? = nil, + _public: Swift.Bool, + closedAt: Foundation.Date? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + number: Swift.Int, + shortDescription: Swift.String? = nil, + deletedAt: Foundation.Date? = nil, + deletedBy: Components.Schemas.NullableSimpleUser? = nil, + state: Components.Schemas.ProjectsV2.StatePayload? = nil, + latestStatusUpdate: Components.Schemas.NullableProjectsV2StatusUpdate? = nil, + isTemplate: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.owner = owner + self.creator = creator + self.title = title + self.description = description + self._public = _public + self.closedAt = closedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.number = number + self.shortDescription = shortDescription + self.deletedAt = deletedAt + self.deletedBy = deletedBy + self.state = state + self.latestStatusUpdate = latestStatusUpdate + self.isTemplate = isTemplate + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case owner + case creator + case title + case description + case _public = "public" + case closedAt = "closed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case number + case shortDescription = "short_description" + case deletedAt = "deleted_at" + case deletedBy = "deleted_by" + case state + case latestStatusUpdate = "latest_status_update" + case isTemplate = "is_template" + } + } + /// An option for a single select field + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options`. + public struct ProjectsV2SingleSelectOptions: Codable, Hashable, Sendable { + /// The unique identifier of the option. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/id`. + public var id: Swift.String + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public struct NamePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/html`. + public var html: Swift.String + /// Creates a new `NamePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public var name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload + /// The description of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public struct DescriptionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/html`. + public var html: Swift.String + /// Creates a new `DescriptionPayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The description of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public var description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload + /// The color associated with the option. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/color`. + public var color: Swift.String + /// Creates a new `ProjectsV2SingleSelectOptions`. + /// + /// - Parameters: + /// - id: The unique identifier of the option. + /// - name: The display name of the option, in raw text and HTML formats. + /// - description: The description of the option, in raw text and HTML formats. + /// - color: The color associated with the option. + public init( + id: Swift.String, + name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload, + description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload, + color: Swift.String + ) { + self.id = id + self.name = name + self.description = description + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case color + } + } + /// An iteration setting for an iteration field + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings`. + public struct ProjectsV2IterationSettings: Codable, Hashable, Sendable { + /// The unique identifier of the iteration setting. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/id`. + public var id: Swift.String + /// The start date of the iteration. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/start_date`. + public var startDate: Swift.String + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/duration`. + public var duration: Swift.Int + /// The iteration title, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public struct TitlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/html`. + public var html: Swift.String + /// Creates a new `TitlePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The iteration title, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public var title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload + /// Whether the iteration has been completed. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/completed`. + public var completed: Swift.Bool + /// Creates a new `ProjectsV2IterationSettings`. + /// + /// - Parameters: + /// - id: The unique identifier of the iteration setting. + /// - startDate: The start date of the iteration. + /// - duration: The duration of the iteration in days. + /// - title: The iteration title, in raw text and HTML formats. + /// - completed: Whether the iteration has been completed. + public init( + id: Swift.String, + startDate: Swift.String, + duration: Swift.Int, + title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload, + completed: Swift.Bool + ) { + self.id = id + self.startDate = startDate + self.duration = duration + self.title = title + self.completed = completed + } + public enum CodingKeys: String, CodingKey { + case id + case startDate = "start_date" + case duration + case title + case completed + } + } + /// A field inside a projects v2 project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field`. + public struct ProjectsV2Field: Codable, Hashable, Sendable { + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/id`. + public var id: Swift.Int + /// The node ID of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/node_id`. + public var nodeId: Swift.String? + /// The API URL of the project that contains the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/project_url`. + public var projectUrl: Swift.String + /// The name of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case assignees = "assignees" + case linkedPullRequests = "linked_pull_requests" + case reviewers = "reviewers" + case labels = "labels" + case milestone = "milestone" + case repository = "repository" + case title = "title" + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + case iteration = "iteration" + case issueType = "issue_type" + case parentIssue = "parent_issue" + case subIssuesProgress = "sub_issues_progress" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + public var dataType: Components.Schemas.ProjectsV2Field.DataTypePayload + /// The options available for single select fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/options`. + public var options: [Components.Schemas.ProjectsV2SingleSelectOptions]? + /// Configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public struct ConfigurationPayload: Codable, Hashable, Sendable { + /// The day of the week when the iteration starts. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/start_day`. + public var startDay: Swift.Int? + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/duration`. + public var duration: Swift.Int? + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/iterations`. + public var iterations: [Components.Schemas.ProjectsV2IterationSettings]? + /// Creates a new `ConfigurationPayload`. + /// + /// - Parameters: + /// - startDay: The day of the week when the iteration starts. + /// - duration: The duration of the iteration in days. + /// - iterations: + public init( + startDay: Swift.Int? = nil, + duration: Swift.Int? = nil, + iterations: [Components.Schemas.ProjectsV2IterationSettings]? = nil + ) { + self.startDay = startDay + self.duration = duration + self.iterations = iterations + } + public enum CodingKeys: String, CodingKey { + case startDay = "start_day" + case duration + case iterations + } + } + /// Configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public var configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? + /// The time when the field was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/created_at`. + public var createdAt: Foundation.Date + /// The time when the field was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectsV2Field`. + /// + /// - Parameters: + /// - id: The unique identifier of the field. + /// - nodeId: The node ID of the field. + /// - projectUrl: The API URL of the project that contains the field. + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - options: The options available for single select fields. + /// - configuration: Configuration for iteration fields. + /// - createdAt: The time when the field was created. + /// - updatedAt: The time when the field was last updated. + public init( + id: Swift.Int, + nodeId: Swift.String? = nil, + projectUrl: Swift.String, + name: Swift.String, + dataType: Components.Schemas.ProjectsV2Field.DataTypePayload, + options: [Components.Schemas.ProjectsV2SingleSelectOptions]? = nil, + configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.nodeId = nodeId + self.projectUrl = projectUrl + self.name = name + self.dataType = dataType + self.options = options + self.configuration = configuration + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectUrl = "project_url" + case name + case dataType = "data_type" + case options + case configuration + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// The type of content tracked in a project item + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-content-type`. + @frozen public enum ProjectsV2ItemContentType: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + case draftIssue = "DraftIssue" + } + /// An item belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content`. + public struct ProjectsV2ItemWithContent: Codable, Hashable, Sendable { + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/id`. + public var id: Swift.Double + /// The node ID of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/node_id`. + public var nodeId: Swift.String? + /// The API URL of the project that contains this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/project_url`. + public var projectUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// The content of the item, which varies by content type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public struct ContentPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ContentPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The content of the item, which varies by content type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public var content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the item was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/created_at`. + public var createdAt: Foundation.Date + /// The time when the item was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/updated_at`. + public var updatedAt: Foundation.Date + /// The time when the item was archived. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/archived_at`. + public var archivedAt: Foundation.Date? + /// The API URL of this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/item_url`. + public var itemUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The fields and values associated with this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public typealias FieldsPayload = [Components.Schemas.ProjectsV2ItemWithContent.FieldsPayloadPayload] + /// The fields and values associated with this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public var fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? + /// Creates a new `ProjectsV2ItemWithContent`. + /// + /// - Parameters: + /// - id: The unique identifier of the project item. + /// - nodeId: The node ID of the project item. + /// - projectUrl: The API URL of the project that contains this item. + /// - contentType: + /// - content: The content of the item, which varies by content type. + /// - creator: + /// - createdAt: The time when the item was created. + /// - updatedAt: The time when the item was last updated. + /// - archivedAt: The time when the item was archived. + /// - itemUrl: The API URL of this item. + /// - fields: The fields and values associated with this item. + public init( + id: Swift.Double, + nodeId: Swift.String? = nil, + projectUrl: Swift.String? = nil, + contentType: Components.Schemas.ProjectsV2ItemContentType, + content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? = nil, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + archivedAt: Foundation.Date? = nil, + itemUrl: Swift.String? = nil, + fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? = nil + ) { + self.id = id + self.nodeId = nodeId + self.projectUrl = projectUrl + self.contentType = contentType + self.content = content + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.archivedAt = archivedAt + self.itemUrl = itemUrl + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectUrl = "project_url" + case contentType = "content_type" + case content + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case archivedAt = "archived_at" + case itemUrl = "item_url" + case fields + } + } + /// Hypermedia Link + /// + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" + } + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. + /// + /// - Parameters: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. + public init( + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String + ) { + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage + } + public enum CodingKeys: String, CodingKey { + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" + } + } + /// Pull Request Simple + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: + public init( + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link + ) { + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self + } + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. + /// + /// - Parameters: + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft + } + } + /// A draft issue in a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue`. + public struct ProjectsV2DraftIssue: Codable, Hashable, Sendable { + /// The ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/id`. + public var id: Swift.Double + /// The node ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/node_id`. + public var nodeId: Swift.String + /// The title of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/title`. + public var title: Swift.String + /// The body content of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// The time the draft issue was created + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/created_at`. + public var createdAt: Foundation.Date + /// The time the draft issue was last updated + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectsV2DraftIssue`. + /// + /// - Parameters: + /// - id: The ID of the draft issue + /// - nodeId: The node ID of the draft issue + /// - title: The title of the draft issue + /// - body: The body content of the draft issue + /// - user: + /// - createdAt: The time the draft issue was created + /// - updatedAt: The time the draft issue was last updated + public init( + id: Swift.Double, + nodeId: Swift.String, + title: Swift.String, + body: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.nodeId = nodeId + self.title = title + self.body = body + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case title + case body + case user + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// An item belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple`. + public struct ProjectsV2ItemSimple: Codable, Hashable, Sendable { + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/id`. + public var id: Swift.Double + /// The node ID of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/node_id`. + public var nodeId: Swift.String? + /// The content represented by the item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + @frozen public enum ContentPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case1`. + case Issue(Components.Schemas.Issue) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case2`. + case PullRequestSimple(Components.Schemas.PullRequestSimple) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case3`. + case ProjectsV2DraftIssue(Components.Schemas.ProjectsV2DraftIssue) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .Issue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ProjectsV2DraftIssue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .Issue(value): + try value.encode(to: encoder) + case let .PullRequestSimple(value): + try value.encode(to: encoder) + case let .ProjectsV2DraftIssue(value): + try value.encode(to: encoder) + } + } + } + /// The content represented by the item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + public var content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the item was created. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/created_at`. + public var createdAt: Foundation.Date + /// The time when the item was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/updated_at`. + public var updatedAt: Foundation.Date + /// The time when the item was archived. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/archived_at`. + public var archivedAt: Foundation.Date? + /// The URL of the project this item belongs to. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/project_url`. + public var projectUrl: Swift.String? + /// The URL of the item in the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/item_url`. + public var itemUrl: Swift.String? + /// Creates a new `ProjectsV2ItemSimple`. + /// + /// - Parameters: + /// - id: The unique identifier of the project item. + /// - nodeId: The node ID of the project item. + /// - content: The content represented by the item. + /// - contentType: + /// - creator: + /// - createdAt: The time when the item was created. + /// - updatedAt: The time when the item was last updated. + /// - archivedAt: The time when the item was archived. + /// - projectUrl: The URL of the project this item belongs to. + /// - itemUrl: The URL of the item in the project. + public init( + id: Swift.Double, + nodeId: Swift.String? = nil, + content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? = nil, + contentType: Components.Schemas.ProjectsV2ItemContentType, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + archivedAt: Foundation.Date? = nil, + projectUrl: Swift.String? = nil, + itemUrl: Swift.String? = nil + ) { + self.id = id + self.nodeId = nodeId + self.content = content + self.contentType = contentType + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.archivedAt = archivedAt + self.projectUrl = projectUrl + self.itemUrl = itemUrl + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case content + case contentType = "content_type" + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case archivedAt = "archived_at" + case projectUrl = "project_url" + case itemUrl = "item_url" + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + public enum Parameters { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-before`. + public typealias PaginationBefore = Swift.String + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-after`. + public typealias PaginationAfter = Swift.String + /// The 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 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 project's number. + /// + /// - Remark: Generated from `#/components/parameters/project-number`. + public typealias ProjectNumber = Swift.Int + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/components/parameters/field-id`. + public typealias FieldId = Swift.Int + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/parameters/item-id`. + public typealias ItemId = Swift.Int + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/components/parameters/user-id`. + public typealias UserId = Swift.String + } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} + public enum Responses { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} + 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 {} +public enum Operations { + /// List projects for organization + /// + /// List all projects owned by a specific organization accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + public enum ProjectsListForOrg { + public static let id: Swift.String = "projects/list-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListForOrg.Input.Path, + query: Operations.ProjectsListForOrg.Input.Query = .init(), + headers: Operations.ProjectsListForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project for organization + /// + /// Get a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public enum ProjectsGetForOrg { + public static let id: Swift.String = "projects/get-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsGetForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetForOrg.Input.Path, + headers: Operations.ProjectsGetForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public enum ProjectsListFieldsForOrg { + public static let id: Swift.String = "projects/list-fields-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListFieldsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListFieldsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListFieldsForOrg.Input.Path, + query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2Field] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListFieldsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListFieldsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project field for organization + /// + /// Get a specific field for an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public enum ProjectsGetFieldForOrg { + public static let id: Swift.String = "projects/get-field-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - fieldId: The unique identifier of the field. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + fieldId: Components.Parameters.FieldId, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.fieldId = fieldId + self.org = org + } + } + public var path: Operations.ProjectsGetFieldForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetFieldForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetFieldForOrg.Input.Path, + headers: Operations.ProjectsGetFieldForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2Field { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetFieldForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetFieldForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public enum ProjectsListItemsForOrg { + public static let id: Swift.String = "projects/list-items-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListItemsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: [Swift.String]? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + fields: [Swift.String]? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.fields = fields + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListItemsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListItemsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListItemsForOrg.Input.Path, + query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListItemsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListItemsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// 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 item to organization owned project + /// + /// Add an issue or pull request item to the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public enum ProjectsAddItemForOrg { + public static let id: Swift.String = "projects/add-item-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/org`. + public var org: Components.Parameters.Org + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - projectNumber: The project's number. + public init( + org: Components.Parameters.Org, + projectNumber: Components.Parameters.ProjectNumber + ) { + self.org = org + self.projectNumber = projectNumber + } + } + public var path: Operations.ProjectsAddItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsAddItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. + public init( + _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload, + id: Swift.Int + ) { + self._type = _type + self.id = id + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case id + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsAddItemForOrg.Input.Path, + headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddItemForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsAddItemForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsAddItemForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an item for an organization owned project + /// + /// Get a specific item from an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public enum ProjectsGetOrgItem { + public static let id: Swift.String = "projects/get-org-item" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsGetOrgItem.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: [Swift.String]? = nil) { + self.fields = fields + } + } + public var query: Operations.ProjectsGetOrgItem.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/header`. + public 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.ProjectsGetOrgItem.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsGetOrgItem.Input.Path, + query: Operations.ProjectsGetOrgItem.Input.Query = .init(), + headers: Operations.ProjectsGetOrgItem.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetOrgItem.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetOrgItem.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetOrgItem.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetOrgItem.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/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 project item for organization + /// + /// Update a specific item in an organization-owned project. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public enum ProjectsUpdateItemForOrg { + public static let id: Swift.String = "projects/update-item-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsUpdateItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. + public 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.ProjectsUpdateItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsUpdateItemForOrg.Input.Path, + headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsUpdateItemForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsUpdateItemForOrg.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//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// 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}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete project item for organization + /// + /// Delete a specific item from an organization-owned project. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public enum ProjectsDeleteItemForOrg { + public static let id: Swift.String = "projects/delete-item-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsDeleteItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsDeleteItemForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsDeleteItemForOrg.Input.Path, + headers: Operations.ProjectsDeleteItemForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project for user + /// + /// Get a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + public enum ProjectsGetForUser { + public static let id: Swift.String = "projects/get-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/user_id`. + public var userId: Components.Parameters.UserId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId + ) { + self.projectNumber = projectNumber + self.userId = userId + } + } + public var path: Operations.ProjectsGetForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetForUser.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//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-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//users/{user_id}/projectsV2/{project_number}/get(projects/get-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//users/{user_id}/projectsV2/{project_number}/get(projects/get-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 fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public enum ProjectsListFieldsForUser { + public static let id: Swift.String = "projects/list-fields-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/user_id`. + public var userId: Components.Parameters.UserId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId + ) { + self.projectNumber = projectNumber + self.userId = userId + } + } + public var path: Operations.ProjectsListFieldsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListFieldsForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2Field] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListFieldsForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListFieldsForUser.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//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-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//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-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//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-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 + ] + } + } + } + /// Get project field for user + /// + /// Get a specific field for a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public enum ProjectsGetFieldForUser { + public static let id: Swift.String = "projects/get-field-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/user_id`. + public var userId: Components.Parameters.UserId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - fieldId: The unique identifier of the field. + /// - userId: The unique identifier of the user. + public init( + projectNumber: Components.Parameters.ProjectNumber, + fieldId: Components.Parameters.FieldId, + userId: Components.Parameters.UserId + ) { + self.projectNumber = projectNumber + self.fieldId = fieldId + self.userId = userId + } + } + public var path: Operations.ProjectsGetFieldForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsGetFieldForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2Field { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetFieldForUser.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.ProjectsGetFieldForUser.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//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-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//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-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//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-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 items for a user owned project + /// + /// List all items for a specific user-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public enum ProjectsListItemsForUser { + public static let id: Swift.String = "projects/list-items-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/user_id`. + public var userId: Components.Parameters.UserId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId + ) { + self.projectNumber = projectNumber + self.userId = userId + } + } + public var path: Operations.ProjectsListItemsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init( + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil, + q: Swift.String? = nil, + fields: [Swift.String]? = nil + ) { + self.before = before + self.after = after + self.perPage = perPage + self.q = q + self.fields = fields + } + } + public var query: Operations.ProjectsListItemsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListItemsForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.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/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForUser.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.ProjectsListItemsForUser.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//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.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//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-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//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-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 + ] + } + } + } + /// Add item to user owned project + /// + /// Add an issue or pull request item to the specified user owned project. + /// + /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public enum ProjectsAddItemForUser { + public static let id: Swift.String = "projects/add-item-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/user_id`. + public var userId: Components.Parameters.UserId + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - userId: The unique identifier of the user. + /// - projectNumber: The project's number. + public init( + userId: Components.Parameters.UserId, + projectNumber: Components.Parameters.ProjectNumber + ) { + self.userId = userId + self.projectNumber = projectNumber + } + } + public var path: Operations.ProjectsAddItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/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.ProjectsAddItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. + public init( + _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, + id: Swift.Int + ) { + self._type = _type + self.id = id + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case id + } + } + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForUser.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.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/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsAddItemForUser.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForUser.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.ProjectsAddItemForUser.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//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-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//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-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 + ] + } + } + } + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public enum ProjectsGetUserItem { + public static let id: Swift.String = "projects/get-user-item" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/user_id`. + public var userId: Components.Parameters.UserId + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.userId = userId + self.itemId = itemId + } + } + public var path: Operations.ProjectsGetUserItem.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: [Swift.String]? = nil) { + self.fields = fields + } + } + public var query: Operations.ProjectsGetUserItem.Input.Query + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_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.ProjectsGetUserItem.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.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/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetUserItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetUserItem.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetUserItem.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetUserItem.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.ProjectsGetUserItem.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//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/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//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/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//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/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 project item for user + /// + /// Update a specific item in a user-owned project. + /// + /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public enum ProjectsUpdateItemForUser { + public static let id: Swift.String = "projects/update-item-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/user_id`. + public var userId: Components.Parameters.UserId + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.userId = userId + self.itemId = itemId + } + } + public var path: Operations.ProjectsUpdateItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_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.ProjectsUpdateItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForUser.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.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/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsUpdateItemForUser.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.ProjectsUpdateItemForUser.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//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-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 + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete project item for user + /// + /// Delete a specific item from a user-owned project. + /// + /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public enum ProjectsDeleteItemForUser { + public static let id: Swift.String = "projects/delete-item-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/user_id`. + public var userId: Components.Parameters.UserId + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - userId: The unique identifier of the user. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + userId: Components.Parameters.UserId, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.userId = userId + self.itemId = itemId + } + } + public var path: Operations.ProjectsDeleteItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-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 projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public enum ProjectsListForUser { + public static let id: Swift.String = "projects/list-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.ProjectsListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsListForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsListForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// + /// 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//users/{username}/projectsV2/get(projects/list-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//users/{username}/projectsV2/get(projects/list-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 + ] + } + } + } +} From 31d6f6a9413c238fe88d44821f769e0af4acde80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:21:59 +0000 Subject: [PATCH 13/46] Bump Submodule/github/rest-api-description from `b27d92b` to `44dd20c` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `b27d92b` to `44dd20c`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/b27d92b4094f9c4c6c60680325830982f04e5449...44dd20c107ca46d1dbcaf4aa522d9039e96e631c) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 44dd20c107ca46d1dbcaf4aa522d9039e96e631c dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index b27d92b409..44dd20c107 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit b27d92b4094f9c4c6c60680325830982f04e5449 +Subproject commit 44dd20c107ca46d1dbcaf4aa522d9039e96e631c From 192a62c6474b9c2468524f53d5ea9f2ff2be4fde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:46:08 +0000 Subject: [PATCH 14/46] Bump github.com/apple/swift-openapi-generator Bumps [github.com/apple/swift-openapi-generator](https://github.com/apple/swift-openapi-generator) from 1.10.2 to 1.10.3. - [Release notes](https://github.com/apple/swift-openapi-generator/releases) - [Commits](https://github.com/apple/swift-openapi-generator/compare/1.10.2...1.10.3) --- updated-dependencies: - dependency-name: github.com/apple/swift-openapi-generator dependency-version: 1.10.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../manifest-swift-openapi-generator/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift index b560af72e3..d4604c8551 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.10.2"), + .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.10.3"), ] ) From 7c65ca555da6b57cbf36c962d16aa050d379ff43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:47:30 +0000 Subject: [PATCH 15/46] Commit via running: make Sources/actions --- Sources/actions/Types.swift | 64 ++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 6db1d3d181..5ffef2c0cf 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -8743,6 +8743,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -8759,6 +8778,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -8772,7 +8794,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -8787,6 +8812,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -8802,6 +8830,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -8875,6 +8906,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -8893,6 +8943,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -8908,6 +8961,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -8923,6 +8979,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -8939,6 +8998,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } From 109176996b00a294080c012c0705ec76a3c45c9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:47:53 +0000 Subject: [PATCH 16/46] Commit via running: make Sources/activity --- Sources/activity/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 1894e76094..490571fb49 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -5066,6 +5066,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5094,10 +5098,6 @@ public enum Components { /// /// - 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 property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. /// /// - Remark: Generated from `#/components/parameters/sort-starred`. From 0c619c76c7c60c9268ac1b77d890952066c2682c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:48:16 +0000 Subject: [PATCH 17/46] Commit via running: make Sources/apps --- Sources/apps/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 95508faeaa..5e4e6f9ef6 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -4790,6 +4790,10 @@ public enum Components { public typealias ClientId = Swift.String /// - Remark: Generated from `#/components/parameters/app-slug`. public typealias AppSlug = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// account_id parameter /// /// - Remark: Generated from `#/components/parameters/account-id`. @@ -4821,10 +4825,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias RepositoryId = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} From 49aa01e39f18a12266dcdda2b22d004922302604 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:48:38 +0000 Subject: [PATCH 18/46] Commit via running: make Sources/billing --- Sources/billing/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 732d2a61fa..6ee6c143a9 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -831,6 +831,10 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. @@ -851,10 +855,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. public typealias BillingUsageReportHour = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} From 31c0250a357fac37c319816e2103f1e6d6c1063a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:51:17 +0000 Subject: [PATCH 19/46] Commit via running: make Sources/gists --- Sources/gists/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index 9165a2da32..1195d3d824 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -2437,6 +2437,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The unique identifier of the gist. /// /// - Remark: Generated from `#/components/parameters/gist-id`. @@ -2445,10 +2449,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/comment-id`. public typealias CommentId = Swift.Int64 - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} From 6af155bfe209c3b65907aed3821a6ef6af94ee02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:52:25 +0000 Subject: [PATCH 20/46] Commit via running: make Sources/issues --- Sources/issues/Types.swift | 64 +++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 3062d39504..508959253c 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -4563,6 +4563,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -4579,6 +4598,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4592,7 +4614,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4607,6 +4632,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4622,6 +4650,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -4695,6 +4726,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -4713,6 +4763,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -4728,6 +4781,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -4743,6 +4799,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -4759,6 +4818,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } From c2924b6b09eeab06c3dd041fa8bf586449b63765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:55:04 +0000 Subject: [PATCH 21/46] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 54 ++-- Sources/orgs/Types.swift | 508 ++++++++++++++++++++++++-------------- 2 files changed, 343 insertions(+), 219 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index b8bd46122c..21cc862d1b 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -7275,11 +7275,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetAllCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema", @@ -7302,7 +7302,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7391,11 +7391,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema", @@ -7427,7 +7427,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7509,11 +7509,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7537,7 +7537,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetCustomProperty.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7622,11 +7622,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7659,7 +7659,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7744,11 +7744,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemoveCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/schema/{}", @@ -7834,11 +7834,11 @@ public struct Client: APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsListCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/values", @@ -7881,13 +7881,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.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.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7980,11 +7980,11 @@ public struct Client: APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( template: "/orgs/{}/properties/values", diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index e7be3d7e74..803448baef 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -727,8 +727,8 @@ public protocol APIProtocol: Sendable { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output /// Create or update custom properties for an organization /// /// Creates new or updates existing custom properties defined for an organization in a batch. @@ -742,16 +742,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output /// Get a custom property for an organization /// /// Gets a custom property that is defined for an organization. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output /// Create or update a custom property for an organization /// /// Creates a new or updates an existing custom property that is defined for an organization. @@ -761,8 +761,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output /// Remove a custom property for an organization /// /// Removes a custom property that is defined for an organization. @@ -772,16 +772,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output /// List custom property values for organization repositories /// /// Lists organization repositories with all of their custom property values. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output /// Create or update custom property values for organization repositories /// /// Create new or update existing custom property values for repositories in a batch that belong to an organization. @@ -796,8 +796,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output /// List public organization members /// /// Members of an organization can choose to have their membership publicized or not. @@ -2258,12 +2258,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() - ) async throws -> Operations.OrgsGetAllCustomProperties.Output { - try await orgsGetAllCustomProperties(Operations.OrgsGetAllCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input( path: path, headers: headers )) @@ -2281,13 +2281,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { - try await orgsCreateOrUpdateCustomProperties(Operations.OrgsCreateOrUpdateCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input( path: path, headers: headers, body: body @@ -2299,12 +2299,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsGetCustomProperty.Output { - try await orgsGetCustomProperty(Operations.OrgsGetCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinition(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input( path: path, headers: headers )) @@ -2318,13 +2318,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { - try await orgsCreateOrUpdateCustomProperty(Operations.OrgsCreateOrUpdateCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input( path: path, headers: headers, body: body @@ -2339,12 +2339,12 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsRemoveCustomProperty.Output { - try await orgsRemoveCustomProperty(Operations.OrgsRemoveCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposDeleteOrganizationDefinition(Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input( path: path, headers: headers )) @@ -2355,13 +2355,13 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() - ) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { - try await orgsListCustomPropertiesValuesForRepos(Operations.OrgsListCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { + try await orgsCustomPropertiesForReposGetOrganizationValues(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input( path: path, query: query, headers: headers @@ -2381,13 +2381,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { - try await orgsCreateOrUpdateCustomPropertiesValuesForRepos(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input( path: path, headers: headers, body: body @@ -6263,6 +6263,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -6279,6 +6298,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -6292,7 +6314,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -6307,6 +6332,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -6322,6 +6350,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -6395,6 +6426,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -6413,6 +6463,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -6428,6 +6481,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -6443,6 +6499,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -6459,6 +6518,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -7312,6 +7374,25 @@ public enum Components { public var repositoriesUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team-role-assignment/parent`. public var parent: Components.Schemas.NullableTeamSimple? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + public var _type: Components.Schemas.TeamRoleAssignment._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamRoleAssignment`. /// /// - Parameters: @@ -7330,6 +7411,9 @@ public enum Components { /// - membersUrl: /// - repositoriesUrl: /// - parent: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( assignment: Components.Schemas.TeamRoleAssignment.AssignmentPayload? = nil, id: Swift.Int, @@ -7345,7 +7429,10 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, - parent: Components.Schemas.NullableTeamSimple? = nil + parent: Components.Schemas.NullableTeamSimple? = nil, + _type: Components.Schemas.TeamRoleAssignment._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.assignment = assignment self.id = id @@ -7362,6 +7449,9 @@ public enum Components { self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl self.parent = parent + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case assignment @@ -7379,6 +7469,9 @@ public enum Components { case membersUrl = "members_url" case repositoriesUrl = "repositories_url" case parent + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -7427,6 +7520,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -7443,6 +7555,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -7456,7 +7571,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -7471,6 +7589,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -7486,6 +7607,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// The Relationship a User has with a role. @@ -8551,6 +8675,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// An organization ID. Only return organizations with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-org`. @@ -8559,10 +8691,6 @@ public enum Components { /// /// - 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 hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -8642,10 +8770,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issue-type-id`. public typealias IssueTypeId = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The unique identifier of the role. /// /// - Remark: Generated from `#/components/parameters/role-id`. @@ -24021,9 +24145,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public enum OrgsGetAllCustomProperties { - public static let id: Swift.String = "orgs/get-all-custom-properties" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definitions" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path`. public struct Path: Sendable, Hashable { @@ -24039,27 +24163,27 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsGetAllCustomProperties.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetAllCustomProperties.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24085,26 +24209,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetAllCustomProperties.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.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.OrgsGetAllCustomProperties.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok { get throws { switch self { case let .ok(response): @@ -24119,7 +24243,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24142,7 +24266,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24207,9 +24331,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public enum OrgsCreateOrUpdateCustomProperties { - public static let id: Swift.String = "orgs/create-or-update-custom-properties" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definitions" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path`. public struct Path: Sendable, Hashable { @@ -24225,19 +24349,19 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json`. @@ -24258,9 +24382,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomProperties.Input.Body.JsonPayload) + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -24268,9 +24392,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body ) { self.path = path self.headers = headers @@ -24297,26 +24421,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.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.OrgsCreateOrUpdateCustomProperties.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok { get throws { switch self { case let .ok(response): @@ -24331,7 +24455,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24354,7 +24478,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24412,9 +24536,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public enum OrgsGetCustomProperty { - public static let id: Swift.String = "orgs/get-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path`. public struct Path: Sendable, Hashable { @@ -24439,27 +24563,27 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsGetCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24485,26 +24609,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetCustomProperty.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetCustomProperty.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetCustomProperty.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.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.OrgsGetCustomProperty.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok { get throws { switch self { case let .ok(response): @@ -24519,7 +24643,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24542,7 +24666,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24603,9 +24727,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public enum OrgsCreateOrUpdateCustomProperty { - public static let id: Swift.String = "orgs/create-or-update-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path`. public struct Path: Sendable, Hashable { @@ -24630,25 +24754,25 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/content/application\/json`. case json(Components.Schemas.CustomPropertySetPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -24656,9 +24780,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body ) { self.path = path self.headers = headers @@ -24685,26 +24809,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.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.OrgsCreateOrUpdateCustomProperty.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok { get throws { switch self { case let .ok(response): @@ -24719,7 +24843,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24742,7 +24866,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24803,9 +24927,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public enum OrgsRemoveCustomProperty { - public static let id: Swift.String = "orgs/remove-custom-property" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public enum OrgsCustomPropertiesForReposDeleteOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-delete-organization-definition" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path`. public struct Path: Sendable, Hashable { @@ -24830,27 +24954,27 @@ public enum Operations { self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsRemoveCustomProperty.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsRemoveCustomProperty.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -24859,13 +24983,13 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// /// HTTP response code: `204 noContent`. case noContent(Components.Responses.NoContent) /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24890,7 +25014,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -24913,7 +25037,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -24971,9 +25095,9 @@ public enum Operations { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public enum OrgsListCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/list-custom-properties-values-for-repos" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public enum OrgsCustomPropertiesForReposGetOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path`. public struct Path: Sendable, Hashable { @@ -24989,7 +25113,7 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." @@ -25020,19 +25144,19 @@ public enum Operations { self.repositoryQuery = repositoryQuery } } - public var query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query + public var query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -25040,9 +25164,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() ) { self.path = path self.query = query @@ -25064,7 +25188,7 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content/application\/json`. @@ -25083,15 +25207,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(), - body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body ) { self.headers = headers self.body = body @@ -25099,15 +25223,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.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.OrgsListCustomPropertiesValuesForRepos.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -25122,7 +25246,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -25145,7 +25269,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -25211,9 +25335,9 @@ public enum Operations { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public enum OrgsCreateOrUpdateCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/create-or-update-custom-properties-values-for-repos" + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { @@ -25229,19 +25353,19 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json`. @@ -25272,9 +25396,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body.JsonPayload) + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -25282,9 +25406,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body ) { self.path = path self.headers = headers @@ -25298,13 +25422,13 @@ public enum Operations { } /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent) + case noContent(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent) /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -25314,7 +25438,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent { + public var noContent: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -25329,7 +25453,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -25352,7 +25476,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -25375,7 +25499,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) From 52ca49977dc587d015a305d1380031b04c421e4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:55:27 +0000 Subject: [PATCH 22/46] Commit via running: make Sources/packages --- Sources/packages/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 36747349f4..17bd982923 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -2323,14 +2323,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The selected visibility of the packages. This parameter is optional and only filters an existing result set. /// /// The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`. From 0631b87e8570f3f8835c6a52eb17f002f45ce75c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:55:49 +0000 Subject: [PATCH 23/46] Commit via running: make Sources/projects-classic --- Sources/projects-classic/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/projects-classic/Types.swift b/Sources/projects-classic/Types.swift index 2ddc354a99..f93db3881e 100644 --- a/Sources/projects-classic/Types.swift +++ b/Sources/projects-classic/Types.swift @@ -1302,6 +1302,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -1314,10 +1318,6 @@ public enum Components { /// /// - 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`. From 1edf14a0684853ae354e9a5d667778fbb2a9edfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:56:12 +0000 Subject: [PATCH 24/46] Commit via running: make Sources/pulls --- Sources/pulls/Types.swift | 97 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 1a700472b7..6cdfe0b457 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -2633,6 +2633,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2649,6 +2668,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2662,7 +2684,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2677,6 +2702,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2692,6 +2720,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -2765,6 +2796,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -2783,6 +2833,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -2798,6 +2851,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -2813,6 +2869,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -2829,6 +2888,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -2878,6 +2940,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -2894,6 +2975,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2907,7 +2991,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2922,6 +3009,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2937,6 +3027,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Hypermedia Link From 7a8aa16b6a20f38b086083d5fcee8b0df85a5263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:56:58 +0000 Subject: [PATCH 25/46] Commit via running: make Sources/reactions --- Sources/reactions/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index b51f7cc81d..c75c28d18d 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -1114,6 +1114,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -1130,10 +1134,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. From 1e509a58f162fe13650be60b871af9d3dc7bc8b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:57:21 +0000 Subject: [PATCH 26/46] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 14 +- Sources/repos/Types.swift | 279 +++++++++++++++++++++++++++++-------- 2 files changed, 229 insertions(+), 64 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 2eeb2872ec..7ed008312a 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -14473,11 +14473,11 @@ public struct Client: APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposGetCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposGetRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", @@ -14501,7 +14501,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + let body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14585,11 +14585,11 @@ public struct Client: APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposCreateOrUpdateCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 0d16e6b595..acbf4cea00 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1590,8 +1590,8 @@ public protocol APIProtocol: Sendable { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output /// Create or update custom property values for a repository /// /// Create new or update existing custom property values for a repository. @@ -1600,8 +1600,8 @@ public protocol APIProtocol: Sendable { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output /// Get a repository README /// /// Gets the preferred README for a repository. @@ -4926,12 +4926,12 @@ extension APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() - ) async throws -> Operations.ReposGetCustomPropertiesValues.Output { - try await reposGetCustomPropertiesValues(Operations.ReposGetCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues( + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() + ) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { + try await reposCustomPropertiesForReposGetRepositoryValues(Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input( path: path, headers: headers )) @@ -4944,13 +4944,13 @@ extension APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body - ) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { - try await reposCreateOrUpdateCustomPropertiesValues(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues( + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body + ) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { + try await reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input( path: path, headers: headers, body: body @@ -9482,6 +9482,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -9498,6 +9517,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -9511,7 +9533,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -9526,6 +9551,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -9541,6 +9569,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -9614,6 +9645,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -9632,6 +9682,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -9647,6 +9700,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -9662,6 +9718,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -9678,6 +9737,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -13543,6 +13605,62 @@ public enum Components { case parameters } } + /// 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-copilot-code-review`. + public struct RepositoryRuleCopilotCodeReview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case copilotCodeReview = "copilot_code_review" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + public var _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_draft_pull_requests`. + public var reviewDraftPullRequests: Swift.Bool? + /// Copilot automatically reviews each new push to the pull request. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_on_push`. + public var reviewOnPush: Swift.Bool? + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - reviewDraftPullRequests: Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// - reviewOnPush: Copilot automatically reviews each new push to the pull request. + public init( + reviewDraftPullRequests: Swift.Bool? = nil, + reviewOnPush: Swift.Bool? = nil + ) { + self.reviewDraftPullRequests = reviewDraftPullRequests + self.reviewOnPush = reviewOnPush + } + public enum CodingKeys: String, CodingKey { + case reviewDraftPullRequests = "review_draft_pull_requests" + case reviewOnPush = "review_on_push" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.ParametersPayload? + /// Creates a new `RepositoryRuleCopilotCodeReview`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload, + parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.ParametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } /// A repository rule. /// /// - Remark: Generated from `#/components/schemas/repository-rule`. @@ -13589,6 +13707,8 @@ public enum Components { case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + /// - Remark: Generated from `#/components/schemas/repository-rule/case22`. + case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -13717,6 +13837,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .RepositoryRuleCopilotCodeReview(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -13767,6 +13893,8 @@ public enum Components { try value.encode(to: encoder) case let .RepositoryRuleCodeScanning(value): try value.encode(to: encoder) + case let .RepositoryRuleCopilotCodeReview(value): + try value.encode(to: encoder) } } } @@ -22318,6 +22446,35 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. case case21(Components.Schemas.RepositoryRuleDetailed.Case21Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + public struct Case22Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value1`. + public var value1: Components.Schemas.RepositoryRuleCopilotCodeReview + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value2`. + public var value2: Components.Schemas.RepositoryRuleRulesetInfo + /// Creates a new `Case22Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRuleCopilotCodeReview, + value2: Components.Schemas.RepositoryRuleRulesetInfo + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + case case22(Components.Schemas.RepositoryRuleDetailed.Case22Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -22446,6 +22603,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case22(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -22496,6 +22659,8 @@ public enum Components { try value.encode(to: encoder) case let .case21(value): try value.encode(to: encoder) + case let .case22(value): + try value.encode(to: encoder) } } } @@ -22942,6 +23107,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -22958,10 +23127,6 @@ public enum Components { /// /// - 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 hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -54350,9 +54515,9 @@ public enum Operations { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public enum ReposGetCustomPropertiesValues { - public static let id: Swift.String = "repos/get-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public enum ReposCustomPropertiesForReposGetRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-get-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/GET/path`. public struct Path: Sendable, Hashable { @@ -54377,27 +54542,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposGetCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ReposGetCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -54423,26 +54588,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + public var body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body) { + public init(body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReposGetCustomPropertiesValues.Output.Ok) + case ok(Operations.ReposCustomPropertiesForReposGetRepositoryValues.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.ReposGetCustomPropertiesValues.Output.Ok { + public var ok: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -54457,7 +54622,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54480,7 +54645,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54540,9 +54705,9 @@ public enum Operations { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public enum ReposCreateOrUpdateCustomPropertiesValues { - public static let id: Swift.String = "repos/create-or-update-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public enum ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-create-or-update-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { @@ -54567,19 +54732,19 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/json`. @@ -54600,9 +54765,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body.JsonPayload) + case json(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body.JsonPayload) } - public var body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + public var body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -54610,9 +54775,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body ) { self.path = path self.headers = headers @@ -54626,13 +54791,13 @@ public enum Operations { } /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent) + case noContent(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent) /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -54642,7 +54807,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent { + public var noContent: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -54657,7 +54822,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54680,7 +54845,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54703,7 +54868,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) From c9f59d4bed8c1267bff7d0a0cfe56edeb6cea8d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:57:44 +0000 Subject: [PATCH 27/46] Commit via running: make Sources/search --- Sources/search/Client.swift | 7 +++++++ Sources/search/Types.swift | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index 95c2694c62..80609104bd 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -393,6 +393,13 @@ public struct Client: APIProtocol { name: "advanced_search", value: input.query.advancedSearch ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "search_type", + value: input.query.searchType + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index d3d33af1bb..3c2ac0f816 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -5255,6 +5255,12 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issues-advanced-search`. public typealias IssuesAdvancedSearch = Swift.String + /// The type of search to perform. Set to `semantic` to perform a semantic search. + /// + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + } } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -6029,6 +6035,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/search/issues/GET/query/advanced_search`. public var advancedSearch: Components.Parameters.IssuesAdvancedSearch? + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + } + /// The type of search to perform. Set to `semantic` to perform a semantic search. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/query/search_type`. + public var searchType: Components.Parameters.SearchType? /// Creates a new `Query`. /// /// - Parameters: @@ -6038,13 +6052,15 @@ public enum Operations { /// - 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)." /// - advancedSearch: Set to `true` to use advanced search. + /// - searchType: The type of search to perform. Set to `semantic` to perform a semantic search. public init( q: Swift.String, sort: Operations.SearchIssuesAndPullRequests.Input.Query.SortPayload? = nil, order: Components.Parameters.Order? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil + advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil, + searchType: Components.Parameters.SearchType? = nil ) { self.q = q self.sort = sort @@ -6052,6 +6068,7 @@ public enum Operations { self.perPage = perPage self.page = page self.advancedSearch = advancedSearch + self.searchType = searchType } } public var query: Operations.SearchIssuesAndPullRequests.Input.Query From b5d2ba096527027f4e67260f7e8cd9f7d4568d69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:58:29 +0000 Subject: [PATCH 28/46] Commit via running: make Sources/teams --- Sources/teams/Types.swift | 123 +++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 14 deletions(-) diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 4cf5f13b32..dff5ebdce8 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -3513,6 +3513,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -3529,6 +3548,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3542,7 +3564,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3557,6 +3582,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3572,6 +3600,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3645,6 +3676,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3663,6 +3713,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3678,6 +3731,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3693,6 +3749,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3709,6 +3768,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4145,6 +4207,10 @@ public enum Components { case archivedAt = "archived_at" } } + /// The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. + /// + /// - Remark: Generated from `#/components/schemas/ldap-dn`. + public typealias LdapDn = Swift.String /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/team-full`. @@ -4211,10 +4277,27 @@ public enum Components { public var updatedAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/team-full/organization`. public var organization: Components.Schemas.TeamOrganization - /// Distinguished Name (DN) that team maps to within LDAP environment - /// /// - Remark: Generated from `#/components/schemas/team-full/ldap_dn`. - public var ldapDn: Swift.String? + public var ldapDn: Components.Schemas.LdapDn? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + public var _type: Components.Schemas.TeamFull._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamFull`. /// /// - Parameters: @@ -4236,7 +4319,10 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - organization: - /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - ldapDn: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4256,7 +4342,10 @@ public enum Components { createdAt: Foundation.Date, updatedAt: Foundation.Date, organization: Components.Schemas.TeamOrganization, - ldapDn: Swift.String? = nil + ldapDn: Components.Schemas.LdapDn? = nil, + _type: Components.Schemas.TeamFull._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4277,6 +4366,9 @@ public enum Components { self.updatedAt = updatedAt self.organization = organization self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4298,6 +4390,9 @@ public enum Components { case updatedAt = "updated_at" case organization case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// A team discussion is a persistent record of a free-form conversation within a team. @@ -5365,6 +5460,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5377,14 +5480,6 @@ public enum Components { /// /// - 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 slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. From 698835cce16cdb6123c5cc7c22266c01eaa1ad3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:58:52 +0000 Subject: [PATCH 29/46] Commit via running: make Sources/users --- Sources/users/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 15e04d2297..6d4706ad01 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -2834,14 +2834,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// account_id parameter - /// - /// - Remark: Generated from `#/components/parameters/account-id`. - public typealias AccountId = Swift.Int /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// account_id parameter + /// + /// - Remark: Generated from `#/components/parameters/account-id`. + public typealias AccountId = Swift.Int /// A user ID. Only return users with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-user`. From b4da77c1aa36380f455a05efba87a5ff529bb8e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:59:15 +0000 Subject: [PATCH 30/46] Commit via running: make Sources/codespaces --- Sources/codespaces/Types.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 65a711b53d..9c27ee78fe 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -6406,6 +6406,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -6422,10 +6426,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-name`. public typealias SecretName = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The name of the codespace. /// /// - Remark: Generated from `#/components/parameters/codespace-name`. From 54b10566d2e2a75728855370b98e3187cb046dc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 21:59:38 +0000 Subject: [PATCH 31/46] Commit via running: make Sources/copilot --- Sources/copilot/Types.swift | 258 ++++++++++++++++++++++-------------- 1 file changed, 162 insertions(+), 96 deletions(-) diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index e70bb5e642..0359223071 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -630,6 +630,101 @@ public enum Components { case userViewType = "user_view_type" } } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. @@ -676,6 +771,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -692,6 +806,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -705,7 +822,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -720,6 +840,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -735,6 +858,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -808,6 +934,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -826,6 +971,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -841,6 +989,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -856,6 +1007,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -872,6 +1026,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -1213,97 +1370,6 @@ public enum Components { case description } } - /// Group of enterprise owners and/or members - /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct EnterpriseTeam: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. - public var syncToOrganizations: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. - public var organizationSelectionType: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var groupId: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. - public var groupName: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `EnterpriseTeam`. - /// - /// - Parameters: - /// - id: - /// - name: - /// - description: - /// - slug: - /// - url: - /// - syncToOrganizations: - /// - organizationSelectionType: - /// - groupId: - /// - groupName: - /// - htmlUrl: - /// - membersUrl: - /// - createdAt: - /// - updatedAt: - public init( - id: Swift.Int64, - name: Swift.String, - description: Swift.String? = nil, - slug: Swift.String, - url: Swift.String, - syncToOrganizations: Swift.String? = nil, - organizationSelectionType: Swift.String? = nil, - groupId: Swift.String? = nil, - groupName: Swift.String? = nil, - htmlUrl: Swift.String, - membersUrl: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.id = id - self.name = name - self.description = description - self.slug = slug - self.url = url - self.syncToOrganizations = syncToOrganizations - self.organizationSelectionType = organizationSelectionType - self.groupId = groupId - self.groupName = groupName - self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case id - case name - case description - case slug - case url - case syncToOrganizations = "sync_to_organizations" - case organizationSelectionType = "organization_selection_type" - case groupId = "group_id" - case groupName = "group_name" - case htmlUrl = "html_url" - case membersUrl = "members_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - } - } /// Information about a Copilot Business seat assignment for a user, team, or organization. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. @@ -2388,10 +2454,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. @@ -2400,6 +2462,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/team-slug`. public typealias TeamSlug = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} From 2517f5172018e5a0f16afe2816fc00b20bf312ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:00:00 +0000 Subject: [PATCH 32/46] Commit via running: make Sources/security-advisories --- Sources/security-advisories/Types.swift | 64 ++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index be06d58ef2..e428d2d54c 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -2982,6 +2982,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2998,6 +3017,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3011,7 +3033,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3026,6 +3051,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3041,6 +3069,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3114,6 +3145,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3132,6 +3182,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3147,6 +3200,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3162,6 +3218,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3178,6 +3237,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } From 0afa05b2c2427bb31820974f5e91ef3594d3770b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:01:32 +0000 Subject: [PATCH 33/46] Commit via running: make Sources/enterprise-teams --- Sources/enterprise-teams/Client.swift | 449 +++++++++ Sources/enterprise-teams/Types.swift | 1295 ++++++++++++++++++++++++- 2 files changed, 1738 insertions(+), 6 deletions(-) diff --git a/Sources/enterprise-teams/Client.swift b/Sources/enterprise-teams/Client.swift index 87202523ac..ff723ec28a 100644 --- a/Sources/enterprise-teams/Client.swift +++ b/Sources/enterprise-teams/Client.swift @@ -38,4 +38,453 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "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.EnterpriseTeamsList.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.EnterpriseTeamsList.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.EnterpriseTeam].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsCreate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamsCreate.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.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.EnterpriseTeamsGet.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.EnterpriseTeamsGet.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.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsUpdate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + 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 headers: Operations.EnterpriseTeamsUpdate.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.EnterpriseTeamsUpdate.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.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/enterprise-teams/Types.swift b/Sources/enterprise-teams/Types.swift index c3d1209ecf..239252f73f 100644 --- a/Sources/enterprise-teams/Types.swift +++ b/Sources/enterprise-teams/Types.swift @@ -10,10 +10,131 @@ import struct Foundation.Data import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable {} +public protocol APIProtocol: Sendable { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsList.Output { + try await enterpriseTeamsList(Operations.EnterpriseTeamsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.Input.Body + ) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await enterpriseTeamsCreate(Operations.EnterpriseTeamsCreate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsGet.Output { + try await enterpriseTeamsGet(Operations.EnterpriseTeamsGet.Input( + path: path, + headers: headers + )) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Input.Body + ) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await enterpriseTeamsUpdate(Operations.EnterpriseTeamsUpdate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await enterpriseTeamsDelete(Operations.EnterpriseTeamsDelete.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -38,16 +159,1178 @@ public enum Servers { /// Types generated from the components section of the OpenAPI document. public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. - public enum Schemas {} + public enum Schemas { + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + 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 slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String + } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} + public enum Responses { + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} + 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 {} +public enum Operations { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public enum EnterpriseTeamsList { + public static let id: Swift.String = "enterprise-teams/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.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/enterprises/{enterprise}/teams/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.EnterpriseTeamsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.EnterpriseTeam]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.EnterpriseTeam] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsList.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.EnterpriseTeamsList.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public enum EnterpriseTeamsCreate { + public static let id: Swift.String = "enterprise-teams/create" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsCreate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsCreate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/name`. + public var name: Swift.String + /// A description of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the team. + /// - description: A description of the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - groupId: The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + public init( + name: Swift.String, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsCreate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsCreate.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamsCreate.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamsCreate.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.EnterpriseTeamsCreate.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public enum EnterpriseTeamsGet { + public static let id: Swift.String = "enterprise-teams/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsGet.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsGet.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsGet.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsGet.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.EnterpriseTeamsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/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 + ) + } + } + } + /// 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 enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public enum EnterpriseTeamsUpdate { + public static let id: Swift.String = "enterprise-teams/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsUpdate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsUpdate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A new name for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A new description for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: A new name for the team. + /// - description: A new description for the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - groupId: The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsUpdate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.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/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/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.EnterpriseTeamsUpdate.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsUpdate.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsUpdate.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.EnterpriseTeamsUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public enum EnterpriseTeamsDelete { + public static let id: Swift.String = "enterprise-teams/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsDelete.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/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.EnterpriseTeamsDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.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//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamsDelete.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/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.EnterpriseTeamsDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} From 32a8acc7d6d58e39635a19587aac812fdfe325ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:01:54 +0000 Subject: [PATCH 34/46] Commit via running: make Sources/enterprise-team-memberships --- .../enterprise-team-memberships/Client.swift | 476 ++++++ .../enterprise-team-memberships/Types.swift | 1401 +++++++++++++++++ 2 files changed, 1877 insertions(+) create mode 100644 Sources/enterprise-team-memberships/Client.swift create mode 100644 Sources/enterprise-team-memberships/Types.swift diff --git a/Sources/enterprise-team-memberships/Client.swift b/Sources/enterprise-team-memberships/Client.swift new file mode 100644 index 0000000000..c84c863594 --- /dev/null +++ b/Sources/enterprise-team-memberships/Client.swift @@ -0,0 +1,476 @@ +// 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 members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + 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.EnterpriseTeamMembershipsList.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.EnterpriseTeamMembershipsList.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 + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/add", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkAdd.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(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/remove", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkRemove.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(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + 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.EnterpriseTeamMembershipsGet.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(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsAdd.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.SimpleUser.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + 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 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/enterprise-team-memberships/Types.swift b/Sources/enterprise-team-memberships/Types.swift new file mode 100644 index 0000000000..12f2f198ba --- /dev/null +++ b/Sources/enterprise-team-memberships/Types.swift @@ -0,0 +1,1401 @@ +// 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 members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await enterpriseTeamMembershipsList(Operations.EnterpriseTeamMembershipsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await enterpriseTeamMembershipsBulkAdd(Operations.EnterpriseTeamMembershipsBulkAdd.Input( + path: path, + headers: headers, + body: body + )) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await enterpriseTeamMembershipsBulkRemove(Operations.EnterpriseTeamMembershipsBulkRemove.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await enterpriseTeamMembershipsGet(Operations.EnterpriseTeamMembershipsGet.Input( + path: path, + headers: headers + )) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await enterpriseTeamMembershipsAdd(Operations.EnterpriseTeamMembershipsAdd.Input( + path: path, + headers: headers + )) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await enterpriseTeamMembershipsRemove(Operations.EnterpriseTeamMembershipsRemove.Input( + path: path, + 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 + } + } + } + /// 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 slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team`. + public typealias EnterpriseTeam = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public enum EnterpriseTeamMembershipsList { + public static let id: Swift.String = "enterprise-team-memberships/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/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.EnterpriseTeamMembershipsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamMembershipsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsList.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.EnterpriseTeamMembershipsList.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public enum EnterpriseTeamMembershipsBulkAdd { + public static let id: Swift.String = "enterprise-team-memberships/bulk-add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/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.EnterpriseTeamMembershipsBulkAdd.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to add to the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to add to the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/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.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body) { + self.body = body + } + } + /// Successfully added team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkAdd.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.EnterpriseTeamMembershipsBulkAdd.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public enum EnterpriseTeamMembershipsBulkRemove { + public static let id: Swift.String = "enterprise-team-memberships/bulk-remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/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.EnterpriseTeamMembershipsBulkRemove.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to be removed from the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to be removed from the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.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/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/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.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body) { + self.body = body + } + } + /// Successfully removed team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkRemove.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.EnterpriseTeamMembershipsBulkRemove.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public enum EnterpriseTeamMembershipsGet { + public static let id: Swift.String = "enterprise-team-memberships/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/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.EnterpriseTeamMembershipsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/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.EnterpriseTeamMembershipsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body) { + self.body = body + } + } + /// User is a member of the enterprise team. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsGet.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.EnterpriseTeamMembershipsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public enum EnterpriseTeamMembershipsAdd { + public static let id: Swift.String = "enterprise-team-memberships/add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/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.EnterpriseTeamMembershipsAdd.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body) { + self.body = body + } + } + /// Successfully added team member + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamMembershipsAdd.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.EnterpriseTeamMembershipsAdd.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public enum EnterpriseTeamMembershipsRemove { + public static let id: Swift.String = "enterprise-team-memberships/remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{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.EnterpriseTeamMembershipsRemove.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.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//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamMembershipsRemove.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/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.EnterpriseTeamMembershipsRemove.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} From a8898338adcc8e9b4c5e3f6521d06b6d2eac27e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:03:47 +0000 Subject: [PATCH 35/46] Commit via running: make Sources/campaigns --- Sources/campaigns/Types.swift | 64 ++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/Sources/campaigns/Types.swift b/Sources/campaigns/Types.swift index b8c21295b9..e774197069 100644 --- a/Sources/campaigns/Types.swift +++ b/Sources/campaigns/Types.swift @@ -437,6 +437,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -453,6 +472,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -466,7 +488,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -481,6 +506,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -496,6 +524,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -569,6 +600,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -587,6 +637,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -602,6 +655,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -617,6 +673,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -633,6 +692,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } From c3f972849abb2d05178599ce87fcde72a59af5fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:04:10 +0000 Subject: [PATCH 36/46] Commit via running: make Sources/projects --- Sources/projects/Client.swift | 340 +++---- Sources/projects/Types.swift | 1762 +++++++++++++++++---------------- 2 files changed, 1080 insertions(+), 1022 deletions(-) diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index 3b8fa88a4b..fb63d96127 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -1217,12 +1217,158 @@ public struct Client: APIProtocol { } ) } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsListForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectsV2].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. public func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output { try await client.send( input: input, @@ -1231,7 +1377,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1340,8 +1486,8 @@ public struct Client: APIProtocol { /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { try await client.send( input: input, @@ -1350,7 +1496,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/fields", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1480,8 +1626,8 @@ public struct Client: APIProtocol { /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. public func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output { try await client.send( input: input, @@ -1490,7 +1636,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/fields/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.fieldId ] @@ -1600,8 +1746,8 @@ public struct Client: APIProtocol { /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. public func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output { try await client.send( input: input, @@ -1610,7 +1756,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1754,8 +1900,8 @@ public struct Client: APIProtocol { /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. public func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output { try await client.send( input: input, @@ -1764,7 +1910,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber ] ) @@ -1874,8 +2020,8 @@ public struct Client: APIProtocol { /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. public func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output { try await client.send( input: input, @@ -1884,7 +2030,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2001,8 +2147,8 @@ public struct Client: APIProtocol { /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. public func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output { try await client.send( input: input, @@ -2011,7 +2157,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2164,8 +2310,8 @@ public struct Client: APIProtocol { /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. public func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output { try await client.send( input: input, @@ -2174,7 +2320,7 @@ public struct Client: APIProtocol { let path = try converter.renderedPath( template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.userId, + input.path.username, input.path.projectNumber, input.path.itemId ] @@ -2250,150 +2396,4 @@ public struct Client: APIProtocol { } ) } - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListForUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/users/{}/projectsV2", - parameters: [ - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "q", - value: input.query.q - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "after", - value: input.query.after - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListForUser.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.ProjectsV2].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } } diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 548e41ea0a..8c558f685a 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -74,69 +74,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output /// List project fields for user /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output /// Get project field for user /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output /// List items for a user owned project /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output /// Add item to user owned project /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output /// Get an item for a user owned project /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output /// Update project item for user /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output /// Delete project item for user /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output } /// Convenience overloads for operation inputs. @@ -288,12 +288,29 @@ extension APIProtocol { headers: headers )) } + /// List projects for user + /// + /// List all projects owned by a specific user accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListForUser.Output { + try await projectsListForUser(Operations.ProjectsListForUser.Input( + path: path, + query: query, + headers: headers + )) + } /// Get project for user /// /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. public func projectsGetForUser( path: Operations.ProjectsGetForUser.Input.Path, headers: Operations.ProjectsGetForUser.Input.Headers = .init() @@ -307,8 +324,8 @@ extension APIProtocol { /// /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. public func projectsListFieldsForUser( path: Operations.ProjectsListFieldsForUser.Input.Path, query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), @@ -324,8 +341,8 @@ extension APIProtocol { /// /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. public func projectsGetFieldForUser( path: Operations.ProjectsGetFieldForUser.Input.Path, headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() @@ -339,8 +356,8 @@ extension APIProtocol { /// /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. public func projectsListItemsForUser( path: Operations.ProjectsListItemsForUser.Input.Path, query: Operations.ProjectsListItemsForUser.Input.Query = .init(), @@ -356,8 +373,8 @@ extension APIProtocol { /// /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. public func projectsAddItemForUser( path: Operations.ProjectsAddItemForUser.Input.Path, headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), @@ -373,8 +390,8 @@ extension APIProtocol { /// /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. public func projectsGetUserItem( path: Operations.ProjectsGetUserItem.Input.Path, query: Operations.ProjectsGetUserItem.Input.Query = .init(), @@ -390,8 +407,8 @@ extension APIProtocol { /// /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. public func projectsUpdateItemForUser( path: Operations.ProjectsUpdateItemForUser.Input.Path, headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), @@ -407,8 +424,8 @@ extension APIProtocol { /// /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. public func projectsDeleteItemForUser( path: Operations.ProjectsDeleteItemForUser.Input.Path, headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() @@ -418,23 +435,6 @@ extension APIProtocol { headers: headers )) } - /// List projects for user - /// - /// List all projects owned by a specific user accessible by the authenticated user. - /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public func projectsListForUser( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForUser.Output { - try await projectsListForUser(Operations.ProjectsListForUser.Input( - path: path, - query: query, - headers: headers - )) - } } /// Server URLs defined in the OpenAPI document. @@ -3032,6 +3032,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -3048,6 +3067,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3061,7 +3083,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3076,6 +3101,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3091,6 +3119,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3164,6 +3195,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3182,6 +3232,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3197,6 +3250,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3212,6 +3268,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3228,6 +3287,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4653,14 +4715,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/per-page`. public typealias PerPage = Swift.Int - /// 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 organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The project's number. /// /// - Remark: Generated from `#/components/parameters/project-number`. @@ -4673,10 +4735,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/item-id`. public typealias ItemId = Swift.Int - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/components/parameters/user-id`. - public typealias UserId = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -7155,69 +7213,101 @@ public enum Operations { } } } - /// Get project for user + /// List projects for user /// - /// Get a specific user-owned project. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)`. - public enum ProjectsGetForUser { - public static let id: Swift.String = "projects/get-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public enum ProjectsListForUser { + public static let id: Swift.String = "projects/list-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. public struct Path: Sendable, Hashable { - /// The project's number. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/project_number`. - public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.projectNumber = projectNumber - self.userId = userId + self.q = q + self.before = before + self.after = after + self.perPage = perPage } } - public var path: Operations.ProjectsGetForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/header`. + public var query: Operations.ProjectsListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsGetForUser.Input.Headers + public var headers: Operations.ProjectsListForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetForUser.Input.Path, - headers: Operations.ProjectsGetForUser.Input.Headers = .init() + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7228,16 +7318,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content`. + public var headers: Operations.ProjectsListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectsV2 { + public var json: [Components.Schemas.ProjectsV2] { get throws { switch self { case let .json(body): @@ -7247,15 +7337,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetForUser.Output.Ok.Body + public var body: Operations.ProjectsListForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetForUser.Output.Ok.Body + headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7263,15 +7353,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetForUser.Output.Ok) + case ok(Operations.ProjectsListForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetForUser.Output.Ok { + public var ok: Operations.ProjectsListForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7286,13 +7376,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7317,7 +7407,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7340,7 +7430,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7392,103 +7482,69 @@ public enum Operations { } } } - /// List project fields for user + /// Get project for user /// - /// List all fields for a specific user-owned project. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. - public enum ProjectsListFieldsForUser { - public static let id: Swift.String = "projects/list-fields-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public enum ProjectsGetForUser { + public static let id: Swift.String = "projects/get-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.userId = userId - } - } - public var path: Operations.ProjectsListFieldsForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after + self.username = username } } - public var query: Operations.ProjectsListFieldsForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/header`. + public var path: Operations.ProjectsGetForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListFieldsForUser.Input.Headers + public var headers: Operations.ProjectsGetForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListFieldsForUser.Input.Path, - query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), - headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7499,16 +7555,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content`. + public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2Field]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ProjectsV2Field] { + public var json: Components.Schemas.ProjectsV2 { get throws { switch self { case let .json(body): @@ -7518,15 +7574,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + public var body: Operations.ProjectsGetForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7534,15 +7590,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListFieldsForUser.Output.Ok) + case ok(Operations.ProjectsGetForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { + public var ok: Operations.ProjectsGetForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7557,13 +7613,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7588,7 +7644,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7611,7 +7667,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7663,76 +7719,103 @@ public enum Operations { } } } - /// Get project field for user + /// List project fields for user /// - /// Get a specific field for a user-owned project. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/fields/{field_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. - public enum ProjectsGetFieldForUser { - public static let id: Swift.String = "projects/get-field-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public enum ProjectsListFieldsForUser { + public static let id: Swift.String = "projects/list-fields-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the field. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. - public var fieldId: Components.Parameters.FieldId - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - fieldId: The unique identifier of the field. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - fieldId: Components.Parameters.FieldId, - userId: Components.Parameters.UserId + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.fieldId = fieldId - self.userId = userId + self.username = username } } - public var path: Operations.ProjectsGetFieldForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/header`. + public var path: Operations.ProjectsListFieldsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsGetFieldForUser.Input.Headers + public var headers: Operations.ProjectsListFieldsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetFieldForUser.Input.Path, - headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7743,16 +7826,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2Field) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectsV2Field { + public var json: [Components.Schemas.ProjectsV2Field] { get throws { switch self { case let .json(body): @@ -7762,15 +7845,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetFieldForUser.Output.Ok.Body + headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7778,15 +7861,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetFieldForUser.Output.Ok) + case ok(Operations.ProjectsListFieldsForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetFieldForUser.Output.Ok { + public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7801,13 +7884,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7832,7 +7915,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7855,7 +7938,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7907,117 +7990,76 @@ public enum Operations { } } } - /// List items for a user owned project + /// Get project field for user /// - /// List all items for a specific user-owned project accessible by the authenticated user. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. - public enum ProjectsListItemsForUser { - public static let id: Swift.String = "projects/list-items-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public enum ProjectsGetFieldForUser { + public static let id: Swift.String = "projects/get-field-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - fieldId: The unique identifier of the field. + /// - username: The handle for the GitHub user account. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId + fieldId: Components.Parameters.FieldId, + username: Components.Parameters.Username ) { self.projectNumber = projectNumber - self.userId = userId - } - } - public var path: Operations.ProjectsListItemsForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query`. - public struct Query: Sendable, Hashable { - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/q`. - public var q: Swift.String? - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/query/fields`. - public var fields: [Swift.String]? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - public init( - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil, - q: Swift.String? = nil, - fields: [Swift.String]? = nil - ) { - self.before = before - self.after = after - self.perPage = perPage - self.q = q - self.fields = fields + self.fieldId = fieldId + self.username = username } } - public var query: Operations.ProjectsListItemsForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/header`. + public var path: Operations.ProjectsGetFieldForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListItemsForUser.Input.Headers + public var headers: Operations.ProjectsGetFieldForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListItemsForUser.Input.Path, - query: Operations.ProjectsListItemsForUser.Input.Query = .init(), - headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.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/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -8028,16 +8070,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content`. + public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2ItemWithContent]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ProjectsV2ItemWithContent] { + public var json: Components.Schemas.ProjectsV2Field { get throws { switch self { case let .json(body): @@ -8047,15 +8089,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListItemsForUser.Output.Ok.Body + headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -8063,15 +8105,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListItemsForUser.Output.Ok) + case ok(Operations.ProjectsGetFieldForUser.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.ProjectsListItemsForUser.Output.Ok { + public var ok: Operations.ProjectsGetFieldForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -8086,13 +8128,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8117,7 +8159,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8140,7 +8182,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8192,118 +8234,137 @@ public enum Operations { } } } - /// Add item to user owned project + /// List items for a user owned project /// - /// Add an issue or pull request item to the specified user owned project. + /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `POST /users/{user_id}/projectsV2/{project_number}/items`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. - public enum ProjectsAddItemForUser { - public static let id: Swift.String = "projects/add-item-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public enum ProjectsListItemsForUser { + public static let id: Swift.String = "projects/list-items-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/user_id`. - public var userId: Components.Parameters.UserId /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - userId: The unique identifier of the user. /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. public init( - userId: Components.Parameters.UserId, - projectNumber: Components.Parameters.ProjectNumber + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username ) { - self.userId = userId self.projectNumber = projectNumber + self.username = username } } - public var path: Operations.ProjectsAddItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/header`. + public var path: Operations.ProjectsListItemsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init( + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil, + q: Swift.String? = nil, + fields: [Swift.String]? = nil + ) { + self.before = before + self.after = after + self.perPage = perPage + self.q = q + self.fields = fields + } + } + public var query: Operations.ProjectsListItemsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsAddItemForUser.Input.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case issue = "Issue" - case pullRequest = "PullRequest" - } - /// The type of item to add to the project. Must be either Issue or PullRequest. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/type`. - public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload - /// The numeric ID of the issue or pull request to add to the project. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/json/id`. - public var id: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. - /// - id: The numeric ID of the issue or pull request to add to the project. - public init( - _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, - id: Swift.Int - ) { - self._type = _type - self.id = id - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case id - } - } - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsAddItemForUser.Input.Body + public var headers: Operations.ProjectsListItemsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsAddItemForUser.Input.Path, - headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), - body: Operations.ProjectsAddItemForUser.Input.Body + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemSimple) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectsV2ItemSimple { + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { get throws { switch self { case let .json(body): @@ -8313,33 +8374,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsAddItemForUser.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { + public init( + headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForUser.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsAddItemForUser.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsAddItemForUser.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListItemsForUser.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -8347,13 +8413,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8378,7 +8444,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8401,7 +8467,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8453,114 +8519,118 @@ public enum Operations { } } } - /// Get an item for a user owned project + /// Add item to user owned project /// - /// Get a specific item from a user-owned project. + /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `GET /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. - public enum ProjectsGetUserItem { - public static let id: Swift.String = "projects/get-user-item" + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public enum ProjectsAddItemForUser { + public static let id: Swift.String = "projects/add-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path`. public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/username`. + public var username: Components.Parameters.Username /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/user_id`. - public var userId: Components.Parameters.UserId - /// The unique identifier of the project item. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. - public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - username: The handle for the GitHub user account. /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. - /// - itemId: The unique identifier of the project item. public init( - projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, - itemId: Components.Parameters.ItemId + username: Components.Parameters.Username, + projectNumber: Components.Parameters.ProjectNumber ) { + self.username = username self.projectNumber = projectNumber - self.userId = userId - self.itemId = itemId - } - } - public var path: Operations.ProjectsGetUserItem.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. - public var fields: [Swift.String]? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. - public init(fields: [Swift.String]? = nil) { - self.fields = fields } } - public var query: Operations.ProjectsGetUserItem.Input.Query - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/header`. + public var path: Operations.ProjectsAddItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsGetUserItem.Input.Headers + public var headers: Operations.ProjectsAddItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. + public init( + _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, + id: Swift.Int + ) { + self._type = _type + self.id = id + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case id + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsGetUserItem.Input.Path, - query: Operations.ProjectsGetUserItem.Input.Query = .init(), - headers: Operations.ProjectsGetUserItem.Input.Headers = .init() + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsGetUserItem.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectsV2ItemWithContent) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectsV2ItemWithContent { + public var json: Components.Schemas.ProjectsV2ItemSimple { get throws { switch self { case let .json(body): @@ -8570,38 +8640,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetUserItem.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsAddItemForUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), - body: Operations.ProjectsGetUserItem.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetUserItem.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetUserItem.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -8609,13 +8674,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -8640,7 +8705,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8663,7 +8728,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8715,176 +8780,108 @@ public enum Operations { } } } - /// Update project item for user + /// Get an item for a user owned project /// - /// Update a specific item in a user-owned project. + /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `PATCH /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. - public enum ProjectsUpdateItemForUser { - public static let id: Swift.String = "projects/update-item-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public enum ProjectsGetUserItem { + public static let id: Swift.String = "projects/get-user-item" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/username`. + public var username: Components.Parameters.Username /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, + username: Components.Parameters.Username, itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber - self.userId = userId + self.username = username self.itemId = itemId } } - public var path: Operations.ProjectsUpdateItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. + public var path: Operations.ProjectsGetUserItem.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: [Swift.String]? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: [Swift.String]? = nil) { + self.fields = fields + } + } + public var query: Operations.ProjectsGetUserItem.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsUpdateItemForUser.Input.Headers - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. - public struct FieldsPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the project field to update. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. - public var id: Swift.Int - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. - case case2(Swift.Double) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The new value for the field: - /// - For text, number, and date fields, provide the new value directly. - /// - For single select and iteration fields, provide the ID of the option or iteration. - /// - To clear the field, set this to null. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. - public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? - /// Creates a new `FieldsPayloadPayload`. - /// - /// - Parameters: - /// - id: The ID of the project field to update. - /// - value: The new value for the field: - public init( - id: Swift.Int, - value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil - ) { - self.id = id - self.value = value - } - public enum CodingKeys: String, CodingKey { - case id - case value - } - } - /// A list of field updates to apply. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] - /// A list of field updates to apply. - /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. - public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - fields: A list of field updates to apply. - public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { - self.fields = fields - } - public enum CodingKeys: String, CodingKey { - case fields - } - } - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateItemForUser.Input.Body + public var headers: Operations.ProjectsGetUserItem.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsUpdateItemForUser.Input.Path, - headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), - body: Operations.ProjectsUpdateItemForUser.Input.Body + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetUserItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// @@ -8900,26 +8897,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + public var body: Operations.ProjectsGetUserItem.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { + public init( + headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetUserItem.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateItemForUser.Output.Ok) + case ok(Operations.ProjectsGetUserItem.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.ProjectsUpdateItemForUser.Output.Ok { + public var ok: Operations.ProjectsGetUserItem.Output.Ok { get throws { switch self { case let .ok(response): @@ -8932,24 +8934,32 @@ public enum Operations { } } } - /// Requires authentication + /// Not modified /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .unauthorized(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notModified", response: self ) } @@ -8957,7 +8967,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8978,47 +8988,24 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } @@ -9055,102 +9042,241 @@ public enum Operations { } } } - /// Delete project item for user + /// Update project item for user /// - /// Delete a specific item from a user-owned project. + /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `DELETE /users/{user_id}/projectsV2/{project_number}/items/{item_id}`. - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. - public enum ProjectsDeleteItemForUser { - public static let id: Swift.String = "projects/delete-item-for-user" + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public enum ProjectsUpdateItemForUser { + public static let id: Swift.String = "projects/update-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The project's number. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. public var projectNumber: Components.Parameters.ProjectNumber - /// The unique identifier of the user. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/user_id`. - public var userId: Components.Parameters.UserId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/username`. + public var username: Components.Parameters.Username /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: /// - projectNumber: The project's number. - /// - userId: The unique identifier of the user. + /// - username: The handle for the GitHub user account. /// - itemId: The unique identifier of the project item. public init( projectNumber: Components.Parameters.ProjectNumber, - userId: Components.Parameters.UserId, + username: Components.Parameters.Username, itemId: Components.Parameters.ItemId ) { self.projectNumber = projectNumber - self.userId = userId + self.username = username self.itemId = itemId } } - public var path: Operations.ProjectsDeleteItemForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{user_id}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public var path: Operations.ProjectsUpdateItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers + public var headers: Operations.ProjectsUpdateItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ProjectsDeleteItemForUser.Input.Path, - headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemWithContent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsUpdateItemForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsUpdateItemForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Requires authentication /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-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 .noContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unauthorized", response: self ) } @@ -9158,7 +9284,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9179,24 +9305,47 @@ public enum Operations { } } } - /// Requires authentication + /// Resource not found /// - /// - Remark: Generated from `#/paths//users/{user_id}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unauthorized(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -9233,193 +9382,102 @@ public enum Operations { } } } - /// List projects for user + /// Delete project item for user /// - /// List all projects owned by a specific user accessible by the authenticated user. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projectsV2`. - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. - public enum ProjectsListForUser { - public static let id: Swift.String = "projects/list-for-user" + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public enum ProjectsDeleteItemForUser { + public static let id: Swift.String = "projects/delete-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/username`. public var username: Components.Parameters.Username + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username - } - } - public var path: Operations.ProjectsListForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. - public struct Query: Sendable, Hashable { - /// Limit results to projects of the specified type. - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. - public var q: Swift.String? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - q: Limit results to projects of the specified type. - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - itemId: The unique identifier of the project item. public init( - q: Swift.String? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - perPage: Components.Parameters.PerPage? = nil + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId ) { - self.q = q - self.before = before - self.after = after - self.perPage = perPage + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId } } - public var query: Operations.ProjectsListForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. + public var path: Operations.ProjectsDeleteItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListForUser.Input.Headers + public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectsV2]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ProjectsV2] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForUser.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { get throws { switch self { - case let .notModified(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "noContent", response: self ) } @@ -9427,7 +9485,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -9450,7 +9508,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) From 27d05430e867491668e82417cbce6859b42981b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:04:11 +0000 Subject: [PATCH 37/46] Commit via running: make Package.swift --- Package.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Package.swift b/Package.swift index 5366bc18ee..43ee15cca5 100644 --- a/Package.swift +++ b/Package.swift @@ -28,6 +28,7 @@ let package = Package( .library(name: "GitHubRestAPIDependency_Graph", targets: ["GitHubRestAPIDependency_Graph"]), .library(name: "GitHubRestAPIDesktop", targets: ["GitHubRestAPIDesktop"]), .library(name: "GitHubRestAPIEmojis", targets: ["GitHubRestAPIEmojis"]), + .library(name: "GitHubRestAPIEnterprise_Team_Memberships", targets: ["GitHubRestAPIEnterprise_Team_Memberships"]), .library(name: "GitHubRestAPIEnterprise_Teams", targets: ["GitHubRestAPIEnterprise_Teams"]), .library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]), .library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]), @@ -197,6 +198,14 @@ let package = Package( ], path: "Sources/emojis" ), + .target( + name: "GitHubRestAPIEnterprise_Team_Memberships", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/enterprise-team-memberships" + ), .target( name: "GitHubRestAPIEnterprise_Teams", dependencies: [ From 5263bbe6011ccb57c2c516003a652090446c2cd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:04:12 +0000 Subject: [PATCH 38/46] Commit via running: make .spi.yml --- .spi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.spi.yml b/.spi.yml index b079a13049..94f66a66e0 100644 --- a/.spi.yml +++ b/.spi.yml @@ -19,6 +19,7 @@ builder: - GitHubRestAPIDependency_Graph - GitHubRestAPIDesktop - GitHubRestAPIEmojis + - GitHubRestAPIEnterprise_Team_Memberships - GitHubRestAPIEnterprise_Teams - GitHubRestAPIGists - GitHubRestAPIGit From 0a5c3951e254f1a869623f1d33ae5b35b44175d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 22 Sep 2025 22:11:34 +0000 Subject: [PATCH 39/46] Commit via running: make Mintfile --- Mintfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mintfile b/Mintfile index b088fe9011..99766dcea9 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ yonaskolb/Mint@0.18.0 -apple/swift-openapi-generator@1.10.2 +apple/swift-openapi-generator@1.10.3 From 6f13c776bba90105fb1a7862a3861078ab07a43e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 23:48:50 +0000 Subject: [PATCH 40/46] Bump Submodule/github/rest-api-description from `44dd20c` to `23ea15f` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `44dd20c` to `23ea15f`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/44dd20c107ca46d1dbcaf4aa522d9039e96e631c...23ea15fe816288eb00bb9c764c5c137fd16f4115) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 23ea15fe816288eb00bb9c764c5c137fd16f4115 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 44dd20c107..23ea15fe81 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 44dd20c107ca46d1dbcaf4aa522d9039e96e631c +Subproject commit 23ea15fe816288eb00bb9c764c5c137fd16f4115 From 4a8b8c89cf19ab7b71b08f4d30f8463082e251e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Sep 2025 00:15:50 +0000 Subject: [PATCH 41/46] Commit via running: make Sources/billing --- Sources/billing/Client.swift | 443 ++++++++++++++ Sources/billing/Types.swift | 1099 +++++++++++++++++++++++++++++++++- 2 files changed, 1530 insertions(+), 12 deletions(-) diff --git a/Sources/billing/Client.swift b/Sources/billing/Client.swift index 3ee2570c21..6aebf40234 100644 --- a/Sources/billing/Client.swift +++ b/Sources/billing/Client.swift @@ -38,6 +38,231 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/premium_request/usage", + 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: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "user", + value: input.query.user + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "model", + value: input.query.model + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BillingPremiumRequestUsageReportOrg.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -569,6 +794,224 @@ public struct Client: APIProtocol { } ) } + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/settings/billing/premium_request/usage", + 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: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "model", + value: input.query.model + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BillingPremiumRequestUsageReportUser.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BillingPremiumRequestUsageReportUser.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 6ee6c143a9..3a2e0454e0 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -11,6 +11,13 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -75,6 +82,13 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. func billingGetGithubPackagesBillingUser(_ input: Operations.BillingGetGithubPackagesBillingUser.Input) async throws -> Operations.BillingGetGithubPackagesBillingUser.Output + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. @@ -99,6 +113,23 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public func billingGetGithubBillingPremiumRequestUsageReportOrg( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { + try await billingGetGithubBillingPremiumRequestUsageReportOrg(Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input( + path: path, + query: query, + headers: headers + )) + } /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -213,6 +244,23 @@ extension APIProtocol { headers: headers )) } + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public func billingGetGithubBillingPremiumRequestUsageReportUser( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output { + try await billingGetGithubBillingPremiumRequestUsageReportUser(Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input( + path: path, + query: query, + headers: headers + )) + } /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. @@ -362,6 +410,197 @@ public enum Components { case schemas } } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org`. + public struct BillingPremiumRequestUsageReportOrg: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. + /// + /// - Parameters: + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. + public init( + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil + ) { + self.year = year + self.month = month + self.day = day + } + public enum CodingKeys: String, CodingKey { + case year + case month + case day + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`. + public var timePeriod: Components.Schemas.BillingPremiumRequestUsageReportOrg.TimePeriodPayload + /// The unique identifier of the organization. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/organization`. + public var organization: Swift.String + /// The name of the user for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/user`. + public var user: Swift.String? + /// The product for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/product`. + public var product: Swift.String? + /// The model for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/model`. + public var model: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Model name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/model`. + public var model: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Int + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Int + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Int + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - model: Model name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + model: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Int, + grossAmount: Swift.Double, + discountQuantity: Swift.Int, + discountAmount: Swift.Double, + netQuantity: Swift.Int, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.model = model + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case model + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/usageItems`. + public var usageItems: Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayload + /// Creates a new `BillingPremiumRequestUsageReportOrg`. + /// + /// - Parameters: + /// - timePeriod: + /// - organization: The unique identifier of the organization. + /// - user: The name of the user for the usage report. + /// - product: The product for the usage report. + /// - model: The model for the usage report. + /// - usageItems: + public init( + timePeriod: Components.Schemas.BillingPremiumRequestUsageReportOrg.TimePeriodPayload, + organization: Swift.String, + user: Swift.String? = nil, + product: Swift.String? = nil, + model: Swift.String? = nil, + usageItems: Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayload + ) { + self.timePeriod = timePeriod + self.organization = organization + self.user = user + self.product = product + self.model = model + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case timePeriod + case organization + case user + case product + case model + case usageItems + } + } /// - Remark: Generated from `#/components/schemas/billing-usage-report`. public struct BillingUsageReport: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/billing-usage-report/UsageItemsPayload`. @@ -720,6 +959,189 @@ public enum Components { case estimatedStorageForMonth = "estimated_storage_for_month" } } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user`. + public struct BillingPremiumRequestUsageReportUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. + /// + /// - Parameters: + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. + public init( + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil + ) { + self.year = year + self.month = month + self.day = day + } + public enum CodingKeys: String, CodingKey { + case year + case month + case day + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod`. + public var timePeriod: Components.Schemas.BillingPremiumRequestUsageReportUser.TimePeriodPayload + /// The unique identifier of the user. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/user`. + public var user: Swift.String + /// The product for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/product`. + public var product: Swift.String? + /// The model for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/model`. + public var model: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Model name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/model`. + public var model: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Int + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Int + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Int + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - model: Model name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + model: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Int, + grossAmount: Swift.Double, + discountQuantity: Swift.Int, + discountAmount: Swift.Double, + netQuantity: Swift.Int, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.model = model + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case model + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/usageItems`. + public var usageItems: Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayload + /// Creates a new `BillingPremiumRequestUsageReportUser`. + /// + /// - Parameters: + /// - timePeriod: + /// - user: The unique identifier of the user. + /// - product: The product for the usage report. + /// - model: The model for the usage report. + /// - usageItems: + public init( + timePeriod: Components.Schemas.BillingPremiumRequestUsageReportUser.TimePeriodPayload, + user: Swift.String, + product: Swift.String? = nil, + model: Swift.String? = nil, + usageItems: Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayload + ) { + self.timePeriod = timePeriod + self.user = user + self.product = product + self.model = model + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case timePeriod + case user + case product + case model + case usageItems + } + } /// - Remark: Generated from `#/components/schemas/billing-usage-report-user`. public struct BillingUsageReportUser: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload`. @@ -843,14 +1265,30 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. public typealias BillingUsageReportYear = Swift.Int - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. - public typealias BillingUsageReportMonth = Swift.Int + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month-default`. + public typealias BillingUsageReportMonthDefault = Swift.Int /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. public typealias BillingUsageReportDay = Swift.Int + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-user`. + public typealias BillingUsageReportUser = Swift.String + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-model`. + public typealias BillingUsageReportModel = Swift.String + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-product`. + public typealias BillingUsageReportProduct = Swift.String + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. + public typealias BillingUsageReportMonth = Swift.Int /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. @@ -860,6 +1298,34 @@ public enum Components { public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. public enum Responses { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } public struct BadRequest: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/bad_request/content`. @frozen public enum Body: Sendable, Hashable { @@ -1025,6 +1491,34 @@ public enum Components { self.body = body } } + public struct BillingPremiumRequestUsageReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content/application\/json`. + case json(Components.Schemas.BillingPremiumRequestUsageReportOrg) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body + /// Creates a new `BillingPremiumRequestUsageReportOrg`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body) { + self.body = body + } + } public struct BillingUsageReportOrg: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. @frozen public enum Body: Sendable, Hashable { @@ -1053,16 +1547,16 @@ public enum Components { self.body = body } } - public struct BillingUsageReportUser: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content`. + public struct BillingPremiumRequestUsageReportUser: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_user/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content/application\/json`. - case json(Components.Schemas.BillingUsageReportUser) + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_user/content/application\/json`. + case json(Components.Schemas.BillingPremiumRequestUsageReportUser) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.BillingUsageReportUser { + public var json: Components.Schemas.BillingPremiumRequestUsageReportUser { get throws { switch self { case let .json(body): @@ -1072,22 +1566,330 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.BillingUsageReportUser.Body - /// Creates a new `BillingUsageReportUser`. + public var body: Components.Responses.BillingPremiumRequestUsageReportUser.Body + /// Creates a new `BillingPremiumRequestUsageReportUser`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.BillingUsageReportUser.Body) { + public init(body: Components.Responses.BillingPremiumRequestUsageReportUser.Body) { self.body = body } } - } + public struct BillingUsageReportUser: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content/application\/json`. + case json(Components.Schemas.BillingUsageReportUser) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingUsageReportUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageReportUser.Body + /// Creates a new `BillingUsageReportUser`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingUsageReportUser.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public enum BillingGetGithubBillingPremiumRequestUsageReportOrg { + public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/user`. + public var user: Components.Parameters.BillingUsageReportUser? + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/model`. + public var model: Components.Parameters.BillingUsageReportModel? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - user: The user name to query usage for. The name is not case sensitive. + /// - model: The model name to query usage for. The name is not case sensitive. + /// - product: The product name to query usage for. The name is not case sensitive. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + user: Components.Parameters.BillingUsageReportUser? = nil, + model: Components.Parameters.BillingUsageReportModel? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil + ) { + self.year = year + self.month = month + self.day = day + self.user = user + self.model = model + self.product = product + } + } + public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response when getting a billing premium request usage report + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingPremiumRequestUsageReportOrg) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -2013,6 +2815,279 @@ public enum Operations { } } } + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public enum BillingGetGithubBillingPremiumRequestUsageReportUser { + public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/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.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/model`. + public var model: Components.Parameters.BillingUsageReportModel? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - model: The model name to query usage for. The name is not case sensitive. + /// - product: The product name to query usage for. The name is not case sensitive. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + model: Components.Parameters.BillingUsageReportModel? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil + ) { + self.year = year + self.month = month + self.day = day + self.model = model + self.product = product + } + } + public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response when getting a billing premium request usage report + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingPremiumRequestUsageReportUser) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingPremiumRequestUsageReportUser { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. From bb26ea66ed2f443459edc0f34fa005de92e3a8df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Sep 2025 00:16:35 +0000 Subject: [PATCH 42/46] Commit via running: make Sources/code-scanning --- Sources/code-scanning/Types.swift | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index e6c4fcf698..6d940e2acb 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -2058,6 +2058,8 @@ public enum Components { public var repository: Components.Schemas.SimpleRepository /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningOrganizationAlertItems`. /// /// - Parameters: @@ -2078,6 +2080,7 @@ public enum Components { /// - mostRecentInstance: /// - repository: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2095,7 +2098,8 @@ public enum Components { tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, repository: Components.Schemas.SimpleRepository, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2114,6 +2118,7 @@ public enum Components { self.mostRecentInstance = mostRecentInstance self.repository = repository self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2133,6 +2138,7 @@ public enum Components { case mostRecentInstance = "most_recent_instance" case repository case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items`. @@ -2169,6 +2175,8 @@ public enum Components { public var mostRecentInstance: Components.Schemas.CodeScanningAlertInstance /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningAlertItems`. /// /// - Parameters: @@ -2188,6 +2196,7 @@ public enum Components { /// - tool: /// - mostRecentInstance: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2204,7 +2213,8 @@ public enum Components { rule: Components.Schemas.CodeScanningAlertRuleSummary, tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2222,6 +2232,7 @@ public enum Components { self.tool = tool self.mostRecentInstance = mostRecentInstance self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2240,6 +2251,7 @@ public enum Components { case tool case mostRecentInstance = "most_recent_instance" case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule`. @@ -2377,6 +2389,8 @@ public enum Components { public var mostRecentInstance: Components.Schemas.CodeScanningAlertInstance /// - Remark: Generated from `#/components/schemas/code-scanning-alert/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningAlert`. /// /// - Parameters: @@ -2396,6 +2410,7 @@ public enum Components { /// - tool: /// - mostRecentInstance: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2412,7 +2427,8 @@ public enum Components { rule: Components.Schemas.CodeScanningAlertRule, tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2430,6 +2446,7 @@ public enum Components { self.tool = tool self.mostRecentInstance = mostRecentInstance self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2448,6 +2465,7 @@ public enum Components { case tool case mostRecentInstance = "most_recent_instance" case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. From 0d59e3efec2d1ee89d4728121f5d9239ad49ccd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Sep 2025 00:22:17 +0000 Subject: [PATCH 43/46] Commit via running: make Sources/orgs --- Sources/orgs/Types.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 803448baef..48433def71 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -11955,25 +11955,31 @@ public enum Operations { public var repositoryId: Swift.Int? /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? /// Creates a new `AttestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repositoryId: /// - bundleUrl: + /// - initiator: public init( bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil ) { self.bundle = bundle self.repositoryId = repositoryId self.bundleUrl = bundleUrl + self.initiator = initiator } public enum CodingKeys: String, CodingKey { case bundle case repositoryId = "repository_id" case bundleUrl = "bundle_url" + case initiator } } /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. From 996e94e1aab4a24c699e2ffcbb1fc0d10a96ca27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Sep 2025 00:24:35 +0000 Subject: [PATCH 44/46] Commit via running: make Sources/repos --- Sources/repos/Types.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index acbf4cea00..8cc427b806 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -27966,25 +27966,31 @@ public enum Operations { public var repositoryId: Swift.Int? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? /// Creates a new `AttestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repositoryId: /// - bundleUrl: + /// - initiator: public init( bundle: Operations.ReposListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil ) { self.bundle = bundle self.repositoryId = repositoryId self.bundleUrl = bundleUrl + self.initiator = initiator } public enum CodingKeys: String, CodingKey { case bundle case repositoryId = "repository_id" case bundleUrl = "bundle_url" + case initiator } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. From 1f7becdca5370f9da7562b802b7c1ac7e37b1302 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Sep 2025 00:26:08 +0000 Subject: [PATCH 45/46] Commit via running: make Sources/users --- Sources/users/Types.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 6d4706ad01..7bfad928dc 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -12601,25 +12601,31 @@ public enum Operations { public var repositoryId: Swift.Int? /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? /// Creates a new `AttestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repositoryId: /// - bundleUrl: + /// - initiator: public init( bundle: Operations.UsersListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil ) { self.bundle = bundle self.repositoryId = repositoryId self.bundleUrl = bundleUrl + self.initiator = initiator } public enum CodingKeys: String, CodingKey { case bundle case repositoryId = "repository_id" case bundleUrl = "bundle_url" + case initiator } } /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. From d5e6b6b34c6434afdf28bc73aceb655bc415ce7f Mon Sep 17 00:00:00 2001 From: Wei18 Date: Wed, 1 Oct 2025 01:28:03 +0000 Subject: [PATCH 46/46] Remove submodule --- .gitmodules | 4 ---- Submodule/github/rest-api-description | 1 - 2 files changed, 5 deletions(-) delete mode 160000 Submodule/github/rest-api-description 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/Submodule/github/rest-api-description b/Submodule/github/rest-api-description deleted file mode 160000 index 23ea15fe81..0000000000 --- a/Submodule/github/rest-api-description +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23ea15fe816288eb00bb9c764c5c137fd16f4115