From efcb3d116d69fa453011266a30ab90aadc91a7c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:22:52 +0000 Subject: [PATCH 01/10] Bump Submodule/github/rest-api-description from `b2ff88e` to `7fad85e` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `b2ff88e` to `7fad85e`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/b2ff88e4eaa64e465b9b210369bfd701e48edd9a...7fad85efbb1da5a0f026a9d53e4e10d862de30fd) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description 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 b2ff88e4eaa..7fad85efbb1 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit b2ff88e4eaa64e465b9b210369bfd701e48edd9a +Subproject commit 7fad85efbb1da5a0f026a9d53e4e10d862de30fd From 2f90a5190e511dfcfdfe89fb8c997f24b04a16ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:41:29 +0000 Subject: [PATCH 02/10] Commit via running ake Sources/actions --- Sources/actions/Client.swift | 4 +++- Sources/actions/Types.swift | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index 904b4653304..de84842651e 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -6723,7 +6723,7 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// - /// This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/get(actions/list-workflow-runs-for-repo)`. @@ -9384,6 +9384,8 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs/get(actions/list-workflow-runs)`. public func actions_sol_list_hyphen_workflow_hyphen_runs(_ input: Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Input) async throws -> Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Output { diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 220613fe563..f07fda0212c 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -997,7 +997,7 @@ public protocol APIProtocol: Sendable { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// - /// This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/get(actions/list-workflow-runs-for-repo)`. @@ -1376,6 +1376,8 @@ public protocol APIProtocol: Sendable { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs/get(actions/list-workflow-runs)`. func actions_sol_list_hyphen_workflow_hyphen_runs(_ input: Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Input) async throws -> Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Output @@ -3163,7 +3165,7 @@ extension APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// - /// This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/get(actions/list-workflow-runs-for-repo)`. @@ -3808,6 +3810,8 @@ extension APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs/get(actions/list-workflow-runs)`. public func actions_sol_list_hyphen_workflow_hyphen_runs( @@ -23442,7 +23446,7 @@ public enum Operations { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// - /// This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/get(actions/list-workflow-runs-for-repo)`. @@ -29355,6 +29359,8 @@ public enum Operations { /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// + /// This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. + /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs/get(actions/list-workflow-runs)`. public enum actions_sol_list_hyphen_workflow_hyphen_runs { From fa19b87dc46d1ac606cb6a440453103bc1b45a22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:41:50 +0000 Subject: [PATCH 03/10] Commit via running ake Sources/activity --- Sources/activity/Types.swift | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 2b16781dd87..1452bab8ffc 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -2611,6 +2611,35 @@ public enum Components { case rocket } } + /// - Remark: Generated from `#/components/schemas/sub-issues-summary`. + public struct sub_hyphen_issues_hyphen_summary: 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 percent_completed: Swift.Int + /// Creates a new `sub_hyphen_issues_hyphen_summary`. + /// + /// - Parameters: + /// - total: + /// - completed: + /// - percent_completed: + public init( + total: Swift.Int, + completed: Swift.Int, + percent_completed: Swift.Int + ) { + self.total = total + self.completed = completed + self.percent_completed = percent_completed + } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percent_completed + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -2838,6 +2867,8 @@ public enum Components { public var author_association: Components.Schemas.author_hyphen_association /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.reaction_hyphen_rollup? + /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. + public var sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? /// Creates a new `issue`. /// /// - Parameters: @@ -2875,6 +2906,7 @@ public enum Components { /// - performed_via_github_app: /// - author_association: /// - reactions: + /// - sub_issues_summary: public init( id: Swift.Int64, node_id: Swift.String, @@ -2909,7 +2941,8 @@ public enum Components { repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, - reactions: Components.Schemas.reaction_hyphen_rollup? = nil + reactions: Components.Schemas.reaction_hyphen_rollup? = nil, + sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? = nil ) { self.id = id self.node_id = node_id @@ -2945,6 +2978,7 @@ public enum Components { self.performed_via_github_app = performed_via_github_app self.author_association = author_association self.reactions = reactions + self.sub_issues_summary = sub_issues_summary } public enum CodingKeys: String, CodingKey { case id @@ -2981,6 +3015,7 @@ public enum Components { case performed_via_github_app case author_association case reactions + case sub_issues_summary } } /// Comments provide a way for people to collaborate on an issue. From 4191f5c5f2ca3fcfefcafb80c252ad45f60e31c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:45:22 +0000 Subject: [PATCH 04/10] Commit via running ake Sources/git --- Sources/git/Types.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Sources/git/Types.swift b/Sources/git/Types.swift index 384a2f3264b..c207282632c 100644 --- a/Sources/git/Types.swift +++ b/Sources/git/Types.swift @@ -787,6 +787,8 @@ public enum Components { 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 verified_at: Swift.String? /// Creates a new `verification`. /// /// - Parameters: @@ -794,22 +796,26 @@ public enum Components { /// - reason: /// - payload: /// - signature: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, payload: Swift.String? = nil, - signature: Swift.String? = nil + signature: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.payload = payload self.signature = signature + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case payload case signature + case verified_at } } /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. @@ -1158,6 +1164,8 @@ public enum Components { public var signature: Swift.String? /// - Remark: Generated from `#/components/schemas/git-commit/verification/payload`. public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/git-commit/verification/verified_at`. + public var verified_at: Swift.String? /// Creates a new `verificationPayload`. /// /// - Parameters: @@ -1165,22 +1173,26 @@ public enum Components { /// - reason: /// - signature: /// - payload: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, signature: Swift.String? = nil, - payload: Swift.String? = nil + payload: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.signature = signature self.payload = payload + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case signature case payload + case verified_at } } /// - Remark: Generated from `#/components/schemas/git-commit/verification`. From 202ad53293b1a8f36b79123e25a20df0c7dd1452 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:46:04 +0000 Subject: [PATCH 05/10] Commit via running ake Sources/issues --- Sources/issues/Client.swift | 628 ++++++++++++++++ Sources/issues/Types.swift | 1350 ++++++++++++++++++++++++++++++++++- 2 files changed, 1975 insertions(+), 3 deletions(-) diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 9b6e5a7eb50..a23c6c803f2 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -3692,6 +3692,634 @@ public struct Client: APIProtocol { } ) } + /// Remove sub-issue + /// + /// You can use the REST API to remove a sub-issue from an issue. + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + public func issues_sol_remove_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output { + try await client.send( + input: input, + forOperation: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/sub_issue", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issue_number + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case 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.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok.Headers = .init(Location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.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( + headers: headers, + body: body + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.bad_request.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.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.scim_hyphen_error.self, + from: responseBody, + transforming: { value in + .application_scim_plus_json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List sub-issues + /// + /// You can use the REST API to list the sub-issues on an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + public func issues_sol_list_hyphen_sub_hyphen_issues(_ input: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input) async throws -> Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output { + try await client.send( + input: input, + forOperation: Operations.issues_sol_list_hyphen_sub_hyphen_issues.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/sub_issues", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issue_number + ] + ) + 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.per_page + ) + 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.issues_sol_list_hyphen_sub_hyphen_issues.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.issues_sol_list_hyphen_sub_hyphen_issues.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( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.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.basic_hyphen_error.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 + ) + ) + } + } + ) + } + /// Add sub-issue + /// + /// You can use the REST API to add sub-issues to issues. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + public func issues_sol_add_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output { + try await client.send( + input: input, + forOperation: Operations.issues_sol_add_hyphen_sub_hyphen_issue.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/sub_issues", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issue_number + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Headers = .init(Location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init( + headers: headers, + body: body + )) + case 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.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Reprioritize sub-issue + /// + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + public func issues_sol_reprioritize_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output { + try await client.send( + input: input, + forOperation: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/sub_issues/priority", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issue_number + ] + ) + 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.issues_sol_reprioritize_hyphen_sub_hyphen_issue.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 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.basic_hyphen_error.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.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.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.validation_failed_simple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error_hyphen_simple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.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 + ) + ) + } + } + ) + } /// List timeline events for an issue /// /// List all timeline events for an issue. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index e109cb7ae36..d3005309ce4 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -318,6 +318,60 @@ 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 issues_sol_unlock(_ input: Operations.issues_sol_unlock.Input) async throws -> Operations.issues_sol_unlock.Output + /// Remove sub-issue + /// + /// You can use the REST API to remove a sub-issue from an issue. + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + func issues_sol_remove_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output + /// List sub-issues + /// + /// You can use the REST API to list the sub-issues on an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + func issues_sol_list_hyphen_sub_hyphen_issues(_ input: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input) async throws -> Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output + /// Add sub-issue + /// + /// You can use the REST API to add sub-issues to issues. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + func issues_sol_add_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output + /// Reprioritize sub-issue + /// + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + func issues_sol_reprioritize_hyphen_sub_hyphen_issue(_ input: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input) async throws -> Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output /// List timeline events for an issue /// /// List all timeline events for an issue. @@ -974,6 +1028,100 @@ extension APIProtocol { headers: headers )) } + /// Remove sub-issue + /// + /// You can use the REST API to remove a sub-issue from an issue. + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + public func issues_sol_remove_hyphen_sub_hyphen_issue( + path: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Body + ) async throws -> Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output { + try await issues_sol_remove_hyphen_sub_hyphen_issue(Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input( + path: path, + headers: headers, + body: body + )) + } + /// List sub-issues + /// + /// You can use the REST API to list the sub-issues on an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + public func issues_sol_list_hyphen_sub_hyphen_issues( + path: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Path, + query: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Query = .init(), + headers: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Headers = .init() + ) async throws -> Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output { + try await issues_sol_list_hyphen_sub_hyphen_issues(Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add sub-issue + /// + /// You can use the REST API to add sub-issues to issues. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + public func issues_sol_add_hyphen_sub_hyphen_issue( + path: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Body + ) async throws -> Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output { + try await issues_sol_add_hyphen_sub_hyphen_issue(Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input( + path: path, + headers: headers, + body: body + )) + } + /// Reprioritize sub-issue + /// + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + public func issues_sol_reprioritize_hyphen_sub_hyphen_issue( + path: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Body + ) async throws -> Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output { + try await issues_sol_reprioritize_hyphen_sub_hyphen_issue(Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input( + path: path, + headers: headers, + body: body + )) + } /// List timeline events for an issue /// /// List all timeline events for an issue. @@ -1387,6 +1535,37 @@ public enum Components { case status } } + /// Validation Error Simple + /// + /// - Remark: Generated from `#/components/schemas/validation-error-simple`. + public struct validation_hyphen_error_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. + public var errors: [Swift.String]? + /// Creates a new `validation_hyphen_error_hyphen_simple`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -3404,6 +3583,35 @@ public enum Components { case rocket } } + /// - Remark: Generated from `#/components/schemas/sub-issues-summary`. + public struct sub_hyphen_issues_hyphen_summary: 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 percent_completed: Swift.Int + /// Creates a new `sub_hyphen_issues_hyphen_summary`. + /// + /// - Parameters: + /// - total: + /// - completed: + /// - percent_completed: + public init( + total: Swift.Int, + completed: Swift.Int, + percent_completed: Swift.Int + ) { + self.total = total + self.completed = completed + self.percent_completed = percent_completed + } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percent_completed + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -3631,6 +3839,8 @@ public enum Components { public var author_association: Components.Schemas.author_hyphen_association /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.reaction_hyphen_rollup? + /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. + public var sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? /// Creates a new `issue`. /// /// - Parameters: @@ -3668,6 +3878,7 @@ public enum Components { /// - performed_via_github_app: /// - author_association: /// - reactions: + /// - sub_issues_summary: public init( id: Swift.Int64, node_id: Swift.String, @@ -3702,7 +3913,8 @@ public enum Components { repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, - reactions: Components.Schemas.reaction_hyphen_rollup? = nil + reactions: Components.Schemas.reaction_hyphen_rollup? = nil, + sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? = nil ) { self.id = id self.node_id = node_id @@ -3738,6 +3950,7 @@ public enum Components { self.performed_via_github_app = performed_via_github_app self.author_association = author_association self.reactions = reactions + self.sub_issues_summary = sub_issues_summary } public enum CodingKeys: String, CodingKey { case id @@ -3774,6 +3987,7 @@ public enum Components { case performed_via_github_app case author_association case reactions + case sub_issues_summary } } /// Comments provide a way for people to collaborate on an issue. @@ -4203,6 +4417,8 @@ public enum Components { public var author_association: Components.Schemas.author_hyphen_association /// - Remark: Generated from `#/components/schemas/nullable-issue/reactions`. public var reactions: Components.Schemas.reaction_hyphen_rollup? + /// - Remark: Generated from `#/components/schemas/nullable-issue/sub_issues_summary`. + public var sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? /// Creates a new `nullable_hyphen_issue`. /// /// - Parameters: @@ -4240,6 +4456,7 @@ public enum Components { /// - performed_via_github_app: /// - author_association: /// - reactions: + /// - sub_issues_summary: public init( id: Swift.Int64, node_id: Swift.String, @@ -4274,7 +4491,8 @@ public enum Components { repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, - reactions: Components.Schemas.reaction_hyphen_rollup? = nil + reactions: Components.Schemas.reaction_hyphen_rollup? = nil, + sub_issues_summary: Components.Schemas.sub_hyphen_issues_hyphen_summary? = nil ) { self.id = id self.node_id = node_id @@ -4310,6 +4528,7 @@ public enum Components { self.performed_via_github_app = performed_via_github_app self.author_association = author_association self.reactions = reactions + self.sub_issues_summary = sub_issues_summary } public enum CodingKeys: String, CodingKey { case id @@ -4346,6 +4565,7 @@ public enum Components { case performed_via_github_app case author_association case reactions + case sub_issues_summary } } /// Issue Event Label @@ -6720,6 +6940,8 @@ public enum Components { public var signature: Swift.String? /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/payload`. public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/verified_at`. + public var verified_at: Swift.String? /// Creates a new `verificationPayload`. /// /// - Parameters: @@ -6727,22 +6949,26 @@ public enum Components { /// - reason: /// - signature: /// - payload: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, signature: Swift.String? = nil, - payload: Swift.String? = nil + payload: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.signature = signature self.payload = payload + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case signature case payload + case verified_at } } /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification`. @@ -8040,6 +8266,34 @@ public enum Components { public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. public enum Responses { + public struct validation_failed_simple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.validation_hyphen_error_hyphen_simple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.validation_hyphen_error_hyphen_simple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.validation_failed_simple.Body + /// Creates a new `validation_failed_simple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.validation_failed_simple.Body) { + self.body = body + } + } public struct not_found: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/not_found/content`. @frozen public enum Body: Sendable, Hashable { @@ -15298,6 +15552,1096 @@ public enum Operations { } } } + /// Remove sub-issue + /// + /// You can use the REST API to remove a sub-issue from an issue. + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + public enum issues_sol_remove_hyphen_sub_hyphen_issue { + public static let id: Swift.String = "issues/remove-sub-issue" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/repo`. + public var repo: Components.Parameters.repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/issue_number`. + public var issue_number: Components.Parameters.issue_hyphen_number + /// 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. + /// - issue_number: The number that identifies the issue. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + issue_number: Components.Parameters.issue_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.issue_number = issue_number + } + } + public var path: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The sub-issue to remove + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. + public var sub_issue_id: Swift.Int + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - sub_issue_id: The sub-issue to remove + public init(sub_issue_id: Swift.Int) { + self.sub_issue_id = sub_issue_id + } + public enum CodingKeys: String, CodingKey { + case sub_issue_id + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/content/application\/json`. + case json(Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Body.jsonPayload) + } + public var body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers/Location`. + public var Location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Location: + public init(Location: Swift.String? = nil) { + self.Location = Location + } + } + /// Received HTTP response headers + public var headers: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok.Headers = .init(), + body: Operations.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.issues_sol_remove_hyphen_sub_hyphen_issue.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.issues_sol_remove_hyphen_sub_hyphen_issue.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.bad_request) + /// 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.bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// 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.not_found { + 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 application_scim_plus_json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .application_scim_plus_json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .application_scim_plus_json: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .application_scim_plus_json + ] + } + } + } + /// List sub-issues + /// + /// You can use the REST API to list the sub-issues on an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + public enum issues_sol_list_hyphen_sub_hyphen_issues { + public static let id: Swift.String = "issues/list-sub-issues" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/repo`. + public var repo: Components.Parameters.repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/issue_number`. + public var issue_number: Components.Parameters.issue_hyphen_number + /// 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. + /// - issue_number: The number that identifies the issue. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + issue_number: Components.Parameters.issue_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.issue_number = issue_number + } + } + public var path: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/page`. + public var page: Components.Parameters.page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - 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( + per_page: Components.Parameters.per_hyphen_page? = nil, + page: Components.Parameters.page? = nil + ) { + self.per_page = per_page + self.page = page + } + } + public var query: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Path, + query: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Query = .init(), + headers: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content/application\/json`. + case json([Components.Schemas.issue]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.issue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output.Ok.Headers = .init(), + body: Operations.issues_sol_list_hyphen_sub_hyphen_issues.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.issues_sol_list_hyphen_sub_hyphen_issues.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.issues_sol_list_hyphen_sub_hyphen_issues.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// 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.not_found { + 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}/sub_issues/get(issues/list-sub-issues)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + 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 sub-issue + /// + /// You can use the REST API to add sub-issues to issues. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + public enum issues_sol_add_hyphen_sub_hyphen_issue { + public static let id: Swift.String = "issues/add-sub-issue" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/repo`. + public var repo: Components.Parameters.repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/issue_number`. + public var issue_number: Components.Parameters.issue_hyphen_number + /// 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. + /// - issue_number: The number that identifies the issue. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + issue_number: Components.Parameters.issue_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.issue_number = issue_number + } + } + public var path: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The sub-issue to add + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. + public var sub_issue_id: Swift.Int + /// Option that, when true, instructs the operation to replace the sub-issues current parent issue + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/replace_parent`. + public var replace_parent: Swift.Bool? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - sub_issue_id: The sub-issue to add + /// - replace_parent: Option that, when true, instructs the operation to replace the sub-issues current parent issue + public init( + sub_issue_id: Swift.Int, + replace_parent: Swift.Bool? = nil + ) { + self.sub_issue_id = sub_issue_id + self.replace_parent = replace_parent + } + public enum CodingKeys: String, CodingKey { + case sub_issue_id + case replace_parent + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/content/application\/json`. + case json(Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Body.jsonPayload) + } + public var body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers/Location`. + public var Location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Location: + public init(Location: Swift.String? = nil) { + self.Location = Location + } + } + /// Received HTTP response headers + public var headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content/application\/json`. + case json(Components.Schemas.issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Headers = .init(), + body: Operations.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.issues_sol_add_hyphen_sub_hyphen_issue.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.issues_sol_add_hyphen_sub_hyphen_issue.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// 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.validation_failed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// 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.not_found { + 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 + ] + } + } + } + /// Reprioritize sub-issue + /// + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + public enum issues_sol_reprioritize_hyphen_sub_hyphen_issue { + public static let id: Swift.String = "issues/reprioritize-sub-issue" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/repo`. + public var repo: Components.Parameters.repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/issue_number`. + public var issue_number: Components.Parameters.issue_hyphen_number + /// 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. + /// - issue_number: The number that identifies the issue. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + issue_number: Components.Parameters.issue_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.issue_number = issue_number + } + } + public var path: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The id of the sub-issue to reprioritize + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/sub_issue_id`. + public var sub_issue_id: Swift.Int + /// The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/after_id`. + public var after_id: Swift.Int? + /// The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/before_id`. + public var before_id: Swift.Int? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - sub_issue_id: The id of the sub-issue to reprioritize + /// - after_id: The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// - before_id: The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + public init( + sub_issue_id: Swift.Int, + after_id: Swift.Int? = nil, + before_id: Swift.Int? = nil + ) { + self.sub_issue_id = sub_issue_id + self.after_id = after_id + self.before_id = before_id + } + public enum CodingKeys: String, CodingKey { + case sub_issue_id + case after_id + case before_id + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/content/application\/json`. + case json(Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Body.jsonPayload) + } + public var body: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Path, + headers: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Headers = .init(), + body: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content/application\/json`. + 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.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.issues_sol_reprioritize_hyphen_sub_hyphen_issue.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.issues_sol_reprioritize_hyphen_sub_hyphen_issue.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// 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.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed_simple) + /// 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.validation_failed_simple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// 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.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List timeline events for an issue /// /// List all timeline events for an issue. From b1bb078cad7303c9d12b92690121541f18f2bc24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:48:33 +0000 Subject: [PATCH 06/10] Commit via running ake Sources/orgs --- Sources/orgs/Client.swift | 8 ++++++-- Sources/orgs/Types.swift | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index fa05bb49a73..cf3359910fc 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -917,7 +917,9 @@ public struct Client: APIProtocol { } /// List organization webhooks /// - /// You must be an organization owner to use this endpoint. + /// List webhooks for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -1380,7 +1382,9 @@ public struct Client: APIProtocol { } /// Delete an organization webhook /// - /// You must be an organization owner to use this endpoint. + /// Delete a webhook for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 155bfea1c20..4e729d20cba 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -114,7 +114,9 @@ public protocol APIProtocol: Sendable { func orgs_sol_list_hyphen_failed_hyphen_invitations(_ input: Operations.orgs_sol_list_hyphen_failed_hyphen_invitations.Input) async throws -> Operations.orgs_sol_list_hyphen_failed_hyphen_invitations.Output /// List organization webhooks /// - /// You must be an organization owner to use this endpoint. + /// List webhooks for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -165,7 +167,9 @@ public protocol APIProtocol: Sendable { func orgs_sol_update_hyphen_webhook(_ input: Operations.orgs_sol_update_hyphen_webhook.Input) async throws -> Operations.orgs_sol_update_hyphen_webhook.Output /// Delete an organization webhook /// - /// You must be an organization owner to use this endpoint. + /// Delete a webhook for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -1000,7 +1004,9 @@ extension APIProtocol { } /// List organization webhooks /// - /// You must be an organization owner to use this endpoint. + /// List webhooks for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -1089,7 +1095,9 @@ extension APIProtocol { } /// Delete an organization webhook /// - /// You must be an organization owner to use this endpoint. + /// Delete a webhook for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -10158,7 +10166,9 @@ public enum Operations { } /// List organization webhooks /// - /// You must be an organization owner to use this endpoint. + /// List webhooks for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. @@ -11118,7 +11128,9 @@ public enum Operations { } /// Delete an organization webhook /// - /// You must be an organization owner to use this endpoint. + /// Delete a webhook for an organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. From 22a3afb29206805c4c05bc2b1136a7851b8629b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:49:36 +0000 Subject: [PATCH 07/10] Commit via running ake Sources/pulls --- Sources/pulls/Types.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index e5378774f36..76cf8e000c0 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -2938,6 +2938,8 @@ public enum Components { 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 verified_at: Swift.String? /// Creates a new `verification`. /// /// - Parameters: @@ -2945,22 +2947,26 @@ public enum Components { /// - reason: /// - payload: /// - signature: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, payload: Swift.String? = nil, - signature: Swift.String? = nil + signature: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.payload = payload self.signature = signature + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case payload case signature + case verified_at } } /// Diff Entry From aada6ee4860b943928a259146b877f120744635b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:50:41 +0000 Subject: [PATCH 08/10] Commit via running ake Sources/repos --- Sources/repos/Client.swift | 2 ++ Sources/repos/Types.swift | 30 ++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index b0d5dd01110..0d89f08a289 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -11479,7 +11479,9 @@ public struct Client: APIProtocol { } /// Delete a repository webhook /// + /// Delete a webhook for an organization. /// + /// The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/hooks/{hook_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/delete(repos/delete-webhook)`. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 58542d30b33..5f3c8b8070f 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1302,7 +1302,9 @@ public protocol APIProtocol: Sendable { func repos_sol_update_hyphen_webhook(_ input: Operations.repos_sol_update_hyphen_webhook.Input) async throws -> Operations.repos_sol_update_hyphen_webhook.Output /// Delete a repository webhook /// + /// Delete a webhook for an organization. /// + /// The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/hooks/{hook_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/delete(repos/delete-webhook)`. @@ -4336,7 +4338,9 @@ extension APIProtocol { } /// Delete a repository webhook /// + /// Delete a webhook for an organization. /// + /// The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/hooks/{hook_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/delete(repos/delete-webhook)`. @@ -15011,6 +15015,8 @@ public enum Components { 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 verified_at: Swift.String? /// Creates a new `verification`. /// /// - Parameters: @@ -15018,22 +15024,26 @@ public enum Components { /// - reason: /// - payload: /// - signature: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, payload: Swift.String? = nil, - signature: Swift.String? = nil + signature: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.payload = payload self.signature = signature + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case payload case signature + case verified_at } } /// Diff Entry @@ -18672,6 +18682,8 @@ public enum Components { public var signature: Swift.String? /// - Remark: Generated from `#/components/schemas/file-commit/commit/verification/payload`. public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/file-commit/commit/verification/verified_at`. + public var verified_at: Swift.String? /// Creates a new `verificationPayload`. /// /// - Parameters: @@ -18679,22 +18691,26 @@ public enum Components { /// - reason: /// - signature: /// - payload: + /// - verified_at: public init( verified: Swift.Bool? = nil, reason: Swift.String? = nil, signature: Swift.String? = nil, - payload: Swift.String? = nil + payload: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.signature = signature self.payload = payload + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case signature case payload + case verified_at } } /// - Remark: Generated from `#/components/schemas/file-commit/commit/verification`. @@ -22210,10 +22226,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/ref-in-query`. public typealias ref_hyphen_in_hyphen_query = Swift.String - /// The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. + /// The name of the repository to filter on. /// /// - Remark: Generated from `#/components/parameters/repository-name-in-query`. - public typealias repository_hyphen_name_hyphen_in_hyphen_query = Swift.Int + public typealias repository_hyphen_name_hyphen_in_hyphen_query = Swift.String /// The time period to filter by. /// /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). @@ -23997,7 +24013,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/rule-suites/GET/query/ref`. public var ref: Components.Parameters.ref_hyphen_in_hyphen_query? - /// The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. + /// The name of the repository to filter on. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/rule-suites/GET/query/repository_name`. public var repository_name: Components.Parameters.repository_hyphen_name_hyphen_in_hyphen_query? @@ -24041,7 +24057,7 @@ public enum Operations { /// /// - Parameters: /// - ref: The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. - /// - repository_name: The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. + /// - repository_name: The name of the repository to filter on. /// - time_period: The time period to filter by. /// - actor_name: The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. /// - rule_suite_result: The rule results to filter on. When specified, only suites with this result will be returned. @@ -46909,7 +46925,9 @@ public enum Operations { } /// Delete a repository webhook /// + /// Delete a webhook for an organization. /// + /// The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/hooks/{hook_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/delete(repos/delete-webhook)`. From d3b0a6920223ae0259e2d0413c0cdca3a915e0d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:51:02 +0000 Subject: [PATCH 09/10] Commit via running ake Sources/search --- Sources/search/Types.swift | 43 +++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 682f5a19352..e1ec4a43051 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -2883,6 +2883,8 @@ public enum Components { 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 verified_at: Swift.String? /// Creates a new `verification`. /// /// - Parameters: @@ -2890,22 +2892,26 @@ public enum Components { /// - reason: /// - payload: /// - signature: + /// - verified_at: public init( verified: Swift.Bool, reason: Swift.String, payload: Swift.String? = nil, - signature: Swift.String? = nil + signature: Swift.String? = nil, + verified_at: Swift.String? = nil ) { self.verified = verified self.reason = reason self.payload = payload self.signature = signature + self.verified_at = verified_at } public enum CodingKeys: String, CodingKey { case verified case reason case payload case signature + case verified_at } } /// - Remark: Generated from `#/components/schemas/search_hyphen_result_hyphen_text_hyphen_matches`. @@ -3377,6 +3383,37 @@ public enum Components { public typealias labelsPayload = [Components.Schemas.issue_hyphen_search_hyphen_result_hyphen_item.labelsPayloadPayload] /// - Remark: Generated from `#/components/schemas/issue-search-result-item/labels`. public var labels: Components.Schemas.issue_hyphen_search_hyphen_result_hyphen_item.labelsPayload + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. + public struct sub_issues_summaryPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/total`. + public var total: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/completed`. + public var completed: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/percent_completed`. + public var percent_completed: Swift.Int + /// Creates a new `sub_issues_summaryPayload`. + /// + /// - Parameters: + /// - total: + /// - completed: + /// - percent_completed: + public init( + total: Swift.Int, + completed: Swift.Int, + percent_completed: Swift.Int + ) { + self.total = total + self.completed = completed + self.percent_completed = percent_completed + } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percent_completed + } + } + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. + public var sub_issues_summary: Components.Schemas.issue_hyphen_search_hyphen_result_hyphen_item.sub_issues_summaryPayload? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state`. public var state: Swift.String /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state_reason`. @@ -3476,6 +3513,7 @@ public enum Components { /// - assignees: /// - user: /// - labels: + /// - sub_issues_summary: /// - state: /// - state_reason: /// - assignee: @@ -3512,6 +3550,7 @@ public enum Components { assignees: [Components.Schemas.simple_hyphen_user]? = nil, user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, labels: Components.Schemas.issue_hyphen_search_hyphen_result_hyphen_item.labelsPayload, + sub_issues_summary: Components.Schemas.issue_hyphen_search_hyphen_result_hyphen_item.sub_issues_summaryPayload? = nil, state: Swift.String, state_reason: Swift.String? = nil, assignee: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, @@ -3548,6 +3587,7 @@ public enum Components { self.assignees = assignees self.user = user self.labels = labels + self.sub_issues_summary = sub_issues_summary self.state = state self.state_reason = state_reason self.assignee = assignee @@ -3585,6 +3625,7 @@ public enum Components { case assignees case user case labels + case sub_issues_summary case state case state_reason case assignee From fbc2a62f39a9607e2c7e908d61415b9d65a978f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 2 Dec 2024 22:51:23 +0000 Subject: [PATCH 10/10] Commit via running ake Sources/secret-scanning --- Sources/secret-scanning/Client.swift | 91 +++++++ Sources/secret-scanning/Types.swift | 355 +++++++++++++++++++++++++++ 2 files changed, 446 insertions(+) diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index e64a11ba3b0..ae7642feced 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -1043,4 +1043,95 @@ public struct Client: APIProtocol { } ) } + /// Get secret scanning scan history for a repository + /// + /// Lists the latest incremental and backfill scans by type for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)`. + public func secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history(_ input: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input) async throws -> Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output { + try await client.send( + input: input, + forOperation: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/scan-history", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 404: + return .notFound(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.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.secret_hyphen_scanning_hyphen_scan_hyphen_history.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 + ) + ) + } + } + ) + } } diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 01039b04b1f..6080ccbb556 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -90,6 +90,15 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/push-protection-bypasses/post(secret-scanning/create-push-protection-bypass)`. func secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass(_ input: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input) async throws -> Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output + /// Get secret scanning scan history for a repository + /// + /// Lists the latest incremental and backfill scans by type for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)`. + func secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history(_ input: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input) async throws -> Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output } /// Convenience overloads for operation inputs. @@ -241,6 +250,23 @@ extension APIProtocol { body: body )) } + /// Get secret scanning scan history for a repository + /// + /// Lists the latest incremental and backfill scans by type for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)`. + public func secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history( + path: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Path, + headers: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Headers = .init() + ) async throws -> Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output { + try await secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history(Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -1989,6 +2015,142 @@ public enum Components { case token_type } } + /// Information on a single scan performed by secret scanning on the repository + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan`. + public struct secret_hyphen_scanning_hyphen_scan: Codable, Hashable, Sendable { + /// The type of scan + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan/type`. + public var _type: Swift.String? + /// The state of the scan. Either "completed" or "running" + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan/status`. + public var status: Swift.String? + /// The time that the scan was completed. Empty if the scan is active + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan/completed_at`. + public var completed_at: Foundation.Date? + /// The time that the scan was started + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan/started_at`. + public var started_at: Foundation.Date? + /// Creates a new `secret_hyphen_scanning_hyphen_scan`. + /// + /// - Parameters: + /// - _type: The type of scan + /// - status: The state of the scan. Either "completed" or "running" + /// - completed_at: The time that the scan was completed. Empty if the scan is active + /// - started_at: The time that the scan was started + public init( + _type: Swift.String? = nil, + status: Swift.String? = nil, + completed_at: Foundation.Date? = nil, + started_at: Foundation.Date? = nil + ) { + self._type = _type + self.status = status + self.completed_at = completed_at + self.started_at = started_at + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case status + case completed_at + case started_at + } + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history`. + public struct secret_hyphen_scanning_hyphen_scan_hyphen_history: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/incremental_scans`. + public var incremental_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/pattern_update_scans`. + public var pattern_update_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/backfill_scans`. + public var backfill_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload`. + public struct custom_pattern_backfill_scansPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload/value1`. + public var value1: Components.Schemas.secret_hyphen_scanning_hyphen_scan + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Name of the custom pattern for custom pattern scans + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload/value2/pattern_name`. + public var pattern_name: Swift.String? + /// Level at which the custom pattern is defined, one of "repository", "organization", or "enterprise" + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload/value2/pattern_scope`. + public var pattern_scope: Swift.String? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - pattern_name: Name of the custom pattern for custom pattern scans + /// - pattern_scope: Level at which the custom pattern is defined, one of "repository", "organization", or "enterprise" + public init( + pattern_name: Swift.String? = nil, + pattern_scope: Swift.String? = nil + ) { + self.pattern_name = pattern_name + self.pattern_scope = pattern_scope + } + public enum CodingKeys: String, CodingKey { + case pattern_name + case pattern_scope + } + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scansPayload/value2`. + public var value2: Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history.custom_pattern_backfill_scansPayloadPayload.Value2Payload + /// Creates a new `custom_pattern_backfill_scansPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.secret_hyphen_scanning_hyphen_scan, + value2: Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history.custom_pattern_backfill_scansPayloadPayload.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scans`. + public typealias custom_pattern_backfill_scansPayload = [Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history.custom_pattern_backfill_scansPayloadPayload] + /// - Remark: Generated from `#/components/schemas/secret-scanning-scan-history/custom_pattern_backfill_scans`. + public var custom_pattern_backfill_scans: Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history.custom_pattern_backfill_scansPayload? + /// Creates a new `secret_hyphen_scanning_hyphen_scan_hyphen_history`. + /// + /// - Parameters: + /// - incremental_scans: + /// - pattern_update_scans: + /// - backfill_scans: + /// - custom_pattern_backfill_scans: + public init( + incremental_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? = nil, + pattern_update_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? = nil, + backfill_scans: [Components.Schemas.secret_hyphen_scanning_hyphen_scan]? = nil, + custom_pattern_backfill_scans: Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history.custom_pattern_backfill_scansPayload? = nil + ) { + self.incremental_scans = incremental_scans + self.pattern_update_scans = pattern_update_scans + self.backfill_scans = backfill_scans + self.custom_pattern_backfill_scans = custom_pattern_backfill_scans + } + public enum CodingKeys: String, CodingKey { + case incremental_scans + case pattern_update_scans + case backfill_scans + case custom_pattern_backfill_scans + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -4165,4 +4327,197 @@ public enum Operations { } } } + /// Get secret scanning scan history for a repository + /// + /// Lists the latest incremental and backfill scans by type for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)`. + public enum secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history { + public static let id: Swift.String = "secret-scanning/get-scan-history" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/scan-history/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}/secret-scanning/scan-history/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}/secret-scanning/scan-history/GET/path/repo`. + public var repo: Components.Parameters.repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/scan-history/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.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Path, + headers: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Repository does not have GitHub Advanced Security or secret scanning enabled + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// 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.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/scan-history/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/scan-history/GET/responses/200/content/application\/json`. + case json(Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.secret_hyphen_scanning_hyphen_scan_hyphen_history { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/scan-history/get(secret-scanning/get-scan-history)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.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.secret_hyphen_scanning_sol_get_hyphen_scan_hyphen_history.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 + ] + } + } + } }